List of utility methods to do JFrame
void | setFrameTitle(JFrame frame, File file) Sets the frame title based on the name of the file. if (file != null) { frame.setTitle(file.getName().substring(0, file.getName().lastIndexOf('.'))); frame.getRootPane().putClientProperty("Window.documentFile", file); } else frame.setTitle("untitled"); |
void | setGeneralParameters(final JFrame window) set General Parameters window.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); window.validate(); window.pack(); window.setVisible(true); |
void | setInfo(String info, JFrame root) set Info sumError += 1; info.equals(""); Component[] components = root.getRootPane().getContentPane().getComponents(); for (int i = 0; i < components.length; i++) { if (components[i].getClass().toString().equals("class javax.swing.JScrollPane")) { JTextArea textarea = (JTextArea) ((JScrollPane) components[i]).getViewport().getView(); if (info.equals("")) { sumError = 0; ... |
void | setJFrameAlwaysOnTop(JFrame frame, boolean newValue) set J Frame Always On Top frame.setAlwaysOnTop(newValue); |
void | setMainWindowLocation(JFrame jfrm, String strPropertiesFilePath, String strPropertiesFileName) Set the location of a JFrame using the values in a specified properties file at a specified location. if (props == null) { props = new Properties(); loadProperties(strPropertiesFilePath, strPropertiesFileName); setMainWindowLocation(jfrm); |
void | setPanel(JPanel parent, JPanel child, JFrame f) Sets a panel inside a panel and updates the size of the containing window. parent.removeAll(); parent.add(child); parent.updateUI(); f.pack(); |
void | setPersistentExtendedStateMask(JFrame frame, int persistentExtendedStateMask) Sets JFrame extended state mask on this frame. frame.getRootPane().putClientProperty(FRAME_PERSISTENT_EXTENDED_STATE_MASK, persistentExtendedStateMask); |
void | setWindowListenerDispose(JFrame frame) set Window Listener Dispose frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { evt.getWindow().dispose(); }); |
void | setWindowRightSide(final JFrame frame) set Window Right Side frame.setExtendedState(JFrame.NORMAL); giveFrameHalfScreen(frame); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice defaultScreen = ge.getDefaultScreenDevice(); Rectangle rect = defaultScreen.getDefaultConfiguration().getBounds(); int x = (int) rect.getMaxX() - frame.getWidth(); int y = 0; frame.setLocation(x, y); ... |
void | setWinVisible(final JFrame win, final boolean vis) set Win Visible SwingUtilities.invokeLater(new Runnable() { public void run() { win.setVisible(vis); }); |