Java JFrame Size setMinMaxSizeFrame(JFrame frame)

Here you can find the source of setMinMaxSizeFrame(JFrame frame)

Description

set Min Max Size Frame

License

Apache License

Declaration

public static void setMinMaxSizeFrame(JFrame frame)

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.*;
import java.awt.*;

public class Main {

    public static void setMinMaxSizeFrame(JFrame frame) {
        setMinSizeFrame(frame);//  w  w  w . ja  va  2s  .  c om
        setMaxSizeFrame(frame);
        frame.setResizable(false);
    }

    public static void setMinSizeFrame(JFrame frame) {
        Dimension dimension = frame.getSize();
        frame.pack();
        frame.setMinimumSize(frame.getSize());
        frame.setSize(dimension);
    }

    public static void setMaxSizeFrame(JFrame frame) {
        frame.pack();
        frame.setMaximumSize(frame.getSize());
    }
}

Related

  1. locateWindow(JFrame parent, Dimension mySize, Dimension offset, JDialog me)
  2. lockInMinSize(final JFrame frame)
  3. positionFrame(final JFrame frame, final Dimension viewSize, final int addX, final int addY)
  4. resizeApp(JFrame app)
  5. restrictWindowMinimumSize(final JInternalFrame frame, final Dimension minSize)
  6. setMinSizeFrame(JFrame frame)
  7. setSizeBasedOnResolution(final JFrame frame)
  8. setSizeWithinScreen(JFrame frame, int preferredWidth, int preferredHeight)
  9. showSplashWindow(String message, Font messageFont, int duration, Dimension windowSize, Window frameOwner)