List of utility methods to do JFrame
void | closeWindow(final JFrame frame) Send a WindowEvent#WINDOW_CLOSING event to the given window. final WindowEvent ev = new WindowEvent(frame, WindowEvent.WINDOW_CLOSING); frame.dispatchEvent(ev); |
void | configToApplicationFrame(JFrame frm) config To Application Frame configToApplicationFrame(frm, "Application");
|
boolean | confirm(JFrame parent, String query, int type) confirm return JOptionPane.showConfirmDialog(parent, query, "UploadR", JOptionPane.YES_NO_OPTION, type) == 0; |
WindowAdapter | createConfirmOnExitAdapter(final JFrame frame, final String title, final String message) create Confirm On Exit Adapter frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); return new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent ev) { int result = JOptionPane.showConfirmDialog(frame, message, title, JOptionPane.YES_OPTION); if (result == JOptionPane.OK_OPTION) { frame.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); System.exit(0); }; |
JDialog | createDialogForPanel(JFrame parent, JPanel panel) create Dialog For Panel JDialog newdialog = new JDialog(parent); newdialog.getContentPane().add(panel, java.awt.BorderLayout.CENTER); newdialog.pack(); return newdialog; |
javax.swing.JFrame | createPackedJFrame(java.awt.Component content, String title, int closeOperation) create Packed J Frame javax.swing.JFrame rv = new javax.swing.JFrame(); rv.setTitle(title); rv.getContentPane().add(content); rv.pack(); rv.setDefaultCloseOperation(closeOperation); return rv; |
void | decorateFrame(JFrame frame, JMenuBar menuBar) _more_ if ((frame != null & menuBar != null) && doMacMenubar()) {
frame.setJMenuBar(menuBar);
|
boolean | deleteFile(String filepath, JFrame parent) Deletes the given file File tempFile = new File(filepath); File trashFile = new File(ClassLoader.getSystemResource("trash").getPath(), new File(filepath).getName()); if (trashFile.exists()) recursiveDeleteFile(trashFile); if (tempFile.exists() && !tempFile.renameTo(trashFile)) { String errstr = "Unable to delete module.. Please check if trash path exists..."; JOptionPane.showMessageDialog(parent, errstr, "File Delete Error", JOptionPane.ERROR_MESSAGE); return false; ... |
int | dialogYesNo(JFrame frame, String title, String message, Object[] options) dialog Yes No JOptionPane pane = new JOptionPane(message); pane.setOptions(options); JDialog dialog = pane.createDialog(frame, title); dialog.setVisible(true); Object obj = pane.getValue(); for (int i = 0; i < options.length; i++) { if (options[i].equals(obj)) { return i; ... |
void | dispAlert(JFrame pFrame, String pTask, String pMessaggio) visualizzazione messaggio HTML JOptionPane.showMessageDialog(pFrame, formattaHTML(pMessaggio), ALERT_TITLE, JOptionPane.OK_CANCEL_OPTION); |