List of utility methods to do JFrame Size
void | restrictWindowMinimumSize(final JInternalFrame frame, final Dimension minSize) Adds listener to internal frame that ensures that the frame is not resized less then specified size. restrictMinimumSizeImpl(frame, minSize); |
void | setMinMaxSizeFrame(JFrame frame) set Min Max Size Frame setMinSizeFrame(frame); setMaxSizeFrame(frame); frame.setResizable(false); |
void | setMinSizeFrame(JFrame frame) set Min Size Frame Dimension dimension = frame.getSize(); frame.pack(); frame.setMinimumSize(frame.getSize()); frame.setSize(dimension); |
void | setSizeBasedOnResolution(final JFrame frame) Set the size of the JFrame based on the resolution of the screen Dimension dimension = getDimensionBasedOnResolution(); frame.setSize(dimension.width, dimension.height); |
void | setSizeWithinScreen(JFrame frame, int preferredWidth, int preferredHeight) set Size Within Screen Dimension screenSize = getMaxSize(frame);
frame.setSize(new Dimension(Math.min(preferredWidth, screenSize.width),
Math.min(preferredHeight, screenSize.height)));
|
void | showSplashWindow(String message, Font messageFont, int duration, Dimension windowSize, Window frameOwner) Displays a splash window for a specific amount of time with a set of rendering parameters for the message, font type, window size and frame owner. JLabel saved = new JLabel(message); saved.setHorizontalAlignment(JLabel.CENTER); saved.setOpaque(true); saved.setFont(messageFont); final JWindow window = new JWindow(frameOwner); window.add(saved, BorderLayout.CENTER); window.setSize(windowSize); saved.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED)); ... |