Hi,
I have a app size (600,600) . How can I limit the user that they can't resize it smaller than (400,400) which mean the minimum size for my app is (400,400) . I tried the setMinimumSize() method but it doesn't work
EX code :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TestDraw extends JFrame {
public TestDraw() {
super("Resize test");
Container c = getContentPane();
JPanel mainFrame = new JPanel(new BorderLayout());
mainFrame.setMinimumSize(new Dimension(400,400));
c.add(mainFrame);
setSize(600,500);
show();
}//end no-argument constructor
public static void main(
String[] args) {
TestDraw app = new TestDraw();
app.addWindowListener(
new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
}
);
}//end main
}//end program