List of utility methods to do JFrame Create
JFrame | createNewFrame(String frameName, int width, int height, boolean visible) create New Frame JFrame frame = new JFrame(frameName); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(width, height); if (visible == true) { frame.pack(); frame.setVisible(visible); return frame; ... |
JFrame | createSearchFrame() create Search Frame JFrame f = new JFrame(); f.pack(); f.setSize(new Dimension(1, 1)); f.setLocationRelativeTo(null); f.setVisible(false); f.setAlwaysOnTop(true); return f; |
JFrame | createSimpleFrame(String title, Component content) Creates a simple JFrame that exits on close with a component in its content pane. JFrame out = new JFrame(title); out.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); out.add(content); out.pack(); return out; |
JFrame | createTestFrame() create Test Frame JPanel panel = new JPanel(new FlowLayout()); JFrame frame = new JFrame(); frame.setSize(200, 200); frame.setLocationRelativeTo(null); frame.setContentPane(panel); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); return frame; |