Here is my case : "The size of the dialog cannot be changes vertically , only horizontally." .
First , i try to use setMaximum , setMinimum method but seems it not work .
Here is my code :
import java.awt.Dimension;
import javax.swing.JDialog;
import javax.swing.JPanel;
/**
* @author tho
*
*/
public class MyDialog extends JDialog {
public MyDialog()
{
super();
Dimension minSize = new Dimension (300,300);
Dimension maxSize = new Dimension (600,300);
this.setPreferredSize(minSize);
this.setMaximumSize(maxSize);
this.setMinimumSize(minSize);
} /**
* @param args
*/
public static void main(String[] args) {
MyDialog testDialog = new MyDialog();
// TODO Auto-generated method stub
}
}