Reputation: 12215
I tried to do something like:
public static void main(final String[] args)
{
JDialog dialog = new JDialog();
dialog.add(new JButton("XXXXXXX"));
dialog.setVisible(true);
dialog.setSize(new Dimension(100,100));
dialog.setMaximumSize(new Dimension(100,100));
}
But I can still resize this dialog above the 100,100 limit I set. Any suggestions? Thanks!
Upvotes: 1
Views: 1376
Reputation: 117685
Try this:
addComponentListener(new java.awt.event.ComponentAdapter()
{
public void componentResized(ComponentEvent event)
{
setSize(100,100);
}
});
Upvotes: 5