Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDialog only allows resize horizontally ?

843806Oct 3 2008 — edited Oct 3 2008
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

	}

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2008
Added on Oct 3 2008
5 comments
775 views