JDK-4093131 : JDialog.setResizable(false) does not work on Solaris
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1.4a,1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1,solaris_2.6
  • CPU: sparc
  • Submitted: 1997-11-14
  • Updated: 1998-01-28
  • Resolved: 1998-01-28
Related Reports
Duplicate :  
Description
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();
   }
}
/*==================================================================*/

Comments
EVALUATION [aim 1/27/98] JDialog relies on awt.Dialog for this support (which has been broken for some time). So, this is essentially a dupliate for: 1231233
11-06-2004