Java Utililty Methods JFrame

List of utility methods to do JFrame

Description

The list of methods to do JFrame are organized into topic(s).

Method

voidmakeTrans(JFrame frmDisks, float f)
make Trans
com.sun.awt.AWTUtilities.setWindowOpacity(frmDisks, f);
voidmaxamiseWindow(JFrame window)
Attempts to maxamise the given JFrame
if (java.awt.Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH)) {
    window.setExtendedState(JFrame.MAXIMIZED_BOTH);
} else {
    System.out.println("Unable to maximise the window");
voidmaximizeJFrame(JFrame f)
Maximizes a JFrame, just like the 'maximize window' button does.
f.setExtendedState(Frame.MAXIMIZED_BOTH);
voidmaximizeWindow(JFrame window)
maximize Window
window.setVisible(true);
window.setExtendedState(Frame.MAXIMIZED_BOTH);
voidmaxIt(JFrame jFrame)
max It
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
Rectangle r = env.getMaximumWindowBounds();
Dimension d = r.getSize();
jFrame.setSize(d);
jFrame.setPreferredSize(d);
voidmessageDialog(String string, JFrame parentFrame)
message Dialog
JOptionPane.showMessageDialog(parentFrame, string);
voidmetalLookAndFeel(JFrame appFrame)
metal Look And Feel
changeLookAndFeel(new MetalLookAndFeel(), appFrame);
voidminimize(JFrame frame)
This method minimizes the window.
frame.setExtendedState(JFrame.ICONIFIED);
voidmsgBox(JFrame frame, String title, String message)
msg Box
msgBox(frame, title, message, JOptionPane.WARNING_MESSAGE);
JDialognewDialog(JFrame owner, String title, JPanel content)
new Dialog
JDialog theDialog = new JDialog(owner, title, true);
theDialog.setContentPane(content);
theDialog.pack();
return theDialog;