private MainFrame() { setDefaultCloseOperation(EXIT_ON_CLOSE); setTitle(Main.APPLICATION_NAME); ProgramWindow.getInstance().setGraphicsDevice(MainFrame.getSelectedGraphicsDevice()); ProgramWindow.getInstance().reloadBackground(); setContentPane( new JPanel() { { setLayout(new BorderLayout()); MainSplitPane splitPane = MainSplitPane.getInstance(); MainTabbedPane tabbedPane = MainTabbedPane.getInstance(); BottomPanel optionPane = BottomPanel.getInstance(); add( new JPanel() { { setLayout(new BorderLayout()); add(SearchField.getInstance(), BorderLayout.CENTER); add( new JPanel() { { setLayout(new GridLayout(1, 2)); add( new JButton() { { setText("Settings"); addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { ConfigPanel configPanel = new ConfigPanel(); JOptionPane.showOptionDialog( MainFrame.this, configPanel, "Settings", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, new JButton[] {configPanel.getOkayButton()}, configPanel.getOkayButton()); } }); } }); add( new JButton() { { setText("About"); addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { JOptionPane.showMessageDialog( MainFrame.this, AboutPanel.getInstance(), "About", JOptionPane.PLAIN_MESSAGE); } }); } }); } }, BorderLayout.EAST); } }, BorderLayout.NORTH); add(splitPane, BorderLayout.CENTER); add(optionPane, BorderLayout.SOUTH); } }); setFocusTraversalPolicy( new DefaultFocusTraversalPolicy() { @Override protected boolean accept(Component c) { return c != SearchField.getInstance(); } }); setSize(1024, 768); setLocationRelativeTo(null); // setExtendedState(MAXIMIZED_BOTH); }