List of utility methods to do JFrame
void | abrirJFrameCentralizado(JFrame dialog) abrir J Frame Centralizado dialog.setLocationRelativeTo(null); dialog.setVisible(true); |
void | activateWindowClosingButton(JFrame frame) activate Window Closing Button frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evnt) { evnt.getWindow().setVisible(false); evnt.getWindow().dispose(); }); |
void | addDisposeActionWithEscapeKey(final JFrame frame) Adds the dispose action with escape key. KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); Action disposeAction = new AbstractAction() { private static final long serialVersionUID = 0L; @Override public void actionPerformed(ActionEvent e) { frame.dispose(); }; ... |
void | addEscapeExitListeners(final JFrame window) add Escape Exit Listeners addKeyAdapterRecursively(window, new KeyAdapter() { @Override public void keyPressed(final KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { System.exit(0); }); ... |
void | addEscapeListener(final JFrame frame) add Escape Listener final ActionListener escListener = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { frame.dispose(); }; frame.getRootPane().registerKeyboardAction(escListener, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); ... |
void | addJFrameReporter(JFrame to) add J Frame Reporter guireporter = new JTextArea();
to.add(guireporter);
|
void | addPanelToFrame(final JFrame frame, final JPanel panel, final String title) Adds the panel to frame. frame.add(panel); frame.setTitle(title); frame.applyComponentOrientation(getDefaultComponentOrientation()); |
JProgressBar | addProgressBar(final JFrame win) add Progress Bar JProgressBar progressBar = new JProgressBar(0, 1); JPanel newRoot = new JPanel(); newRoot.setLayout(new BoxLayout(newRoot, BoxLayout.Y_AXIS)); newRoot.add(win.getContentPane()); newRoot.add(progressBar); win.setContentPane(newRoot); win.pack(); return progressBar; ... |
void | addToQue(JFrame frame) add To Que reaktivationQue.add(frame); |
File[] | allPlatformGetFile(String dialogTitle, File locationIn, final String fileExtension, FileFilter nonMacFileFilter, boolean allowMultipleSelect, JFrame parentFrame) all Platform Get File File location = locationIn; if (location == null) { location = new File("default location"); File[] returnFile = new File[] { null }; JFileChooser fc = new JFileChooser(location); fc.setDialogType(JFileChooser.OPEN_DIALOG); fc.addChoosableFileFilter(nonMacFileFilter); ... |