public KeyOptionDialog(Frame parent) { this.setTitle("Keyboard Setting"); this.setModal(true); this.setResizable(false); // this.setSize(230, 284); this.setBounds((int) parent.getX() + 20, (int) parent.getY() + 75, 230, 200); ls.setLanguage(gameconfigure.getLanguage()); try { jbInit(); } catch (Exception e) { e.printStackTrace(); } }
@Override public void mouseMovedOrUp(int x, int y, int button) { if (Minecraft.getMinecraft().currentScreen == null) return; super.mouseMovedOrUp(x, y, button); for (Frame frame : guiManager.getFrames()) { if (!frame.isVisible()) continue; if (!frame.isMinimized() && !frame.getArea().contains(x, y)) { for (Component component : frame.getChildren()) { for (Rectangle area : component.getTheme().getUIForComponent(component).getInteractableRegions(component)) { if (area.contains( x - frame.getX() - component.getX(), y - frame.getY() - component.getY())) { frame.onMouseRelease(x - frame.getX(), y - frame.getY(), button); guiManager.bringForward(frame); return; } } } } } for (Frame frame : guiManager.getFrames()) { if (!frame.isVisible()) continue; if (!frame.isMinimized() && frame.getArea().contains(x, y)) { frame.onMouseRelease(x - frame.getX(), y - frame.getY(), button); guiManager.bringForward(frame); break; } else if (frame.isMinimized()) { for (Rectangle area : frame.getTheme().getUIForComponent(frame).getInteractableRegions(frame)) { if (area.contains(x - frame.getX(), y - frame.getY())) { frame.onMouseRelease(x - frame.getX(), y - frame.getY(), button); guiManager.bringForward(frame); return; } } } } }