-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1.4a, 1.2.0
-
None
-
sparc
-
solaris_2.5.1, solaris_2.6
On Solaris, a JDialog on which setResizable(false) is invoked can
be resized.
To see this, bring up the application given below on Solaris and
press the 'Press to show dialog' button.
This brings up a JDialog on which setResizable(false) has been
invoked.
Attempts to resize the JDialog succeed.
/*==================================================================*/
/*
* JDialog.setResizable(false) does not work on Solaris
*/
import java.awt.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JDialogTest {
static JFrame frame = new JFrame();
static JDialog dialog = new JDialog(new JFrame());
static JButton showButton = new JButton("Press to show dialog");
public static void main (String[] args) {
dialog.setSize(200,200);
System.out.println("isResizable(): " + dialog.isResizable());
System.out.println("Invoking setResizable(false)... ");
dialog.setResizable(false);
System.out.println("isResizable(): " + dialog.isResizable());
showButton.setBackground(Color.yellow);
frame.add("North", showButton);
showButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.setVisible(true);
}
});
dialog.addWindowListener (new WindowAdapter () {
public void windowClosing (WindowEvent e) {
dialog.dispose ();
System.exit (0);
}
});
frame.pack();
frame.setSize(200,100);
frame.show();
}
}
/*==================================================================*/
- duplicates
-
JDK-1231233 Frame.setResizable(false) does not prevent resizing.
-
- Closed
-