List of utility methods to do JFrame
void | fullScreenWithAPI(JFrame w) full Screen With API Rectangle r = null; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); GraphicsDevice gd = w.getGraphicsConfiguration().getDevice(); if (gs.length > 0) { GraphicsDevice device = gs[0]; if (device.isFullScreenSupported()) { System.out.println("Full screen supported"); ... |
File | getFileSelection(JFrame parent, boolean onlyDirectories, String startingDir) get File Selection if (System.getProperty("os.name").toLowerCase().indexOf("mac") != -1) { FileDialog fileDialog = new FileDialog(parent, "Select directory to dump source into", FileDialog.LOAD); fileDialog.setDirectory(startingDir); fileDialog.setVisible(true); if (fileDialog.getFile() != null) { return new File(fileDialog.getFile()); } else { ... |
JFrame | getJFrame(Component cmp) Gets the parent JFrame of the component. return (JFrame) SwingUtilities.getWindowAncestor(cmp);
|
JFrame | getjFrame(int width, int height) getj Frame JFrame frame = new JFrame(WINDOW_TITLE); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setSize(width, height); return frame; |
JFrame | getJFrame(JPanel panel, String title, int width, int height) get J Frame JFrame f = new JFrame(title); f.setContentPane(panel); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(new Dimension(width, height)); return f; |
JFrame | getJFrame(Window window) get J Frame if (window instanceof JFrame) { return (JFrame) window; return null; |
JFrame | getJFrameOfComponent(Component cmpnt) get J Frame Of Component if (cmpnt == null) { throw new IllegalArgumentException("cmpnt == null"); Container cntr = cmpnt.getParent(); while (true) { if (cntr == null) break; if (cntr instanceof JFrame) ... |
JDialog | getModalDlg(JFrame frame, String title) get Modal Dlg JDialog dlg; if (frame == null) dlg = new JDialog(__frame, true); else if (__modalDlg != null && __modalDlg.isVisible()) dlg = null; else dlg = __modalDlg = new JDialog(frame, true); dlg.setModal(true); ... |
JFrame | getParentJFrame(Component c) get Parent J Frame for (Container p = c.getParent(); p != null; p = p.getParent()) { if (p instanceof JFrame) { return (JFrame) p; return null; |
JFrame | getParentJFrame(Container theFrame) finds a parent JFrame for the specified container. do { theFrame = theFrame.getParent(); } while ((theFrame != null) && !(theFrame instanceof JFrame)); if (theFrame == null) theFrame = new JFrame(); return (JFrame) theFrame; |