Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4093131

JDialog.setResizable(false) does not work on Solaris

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.4a, 1.2.0
    • client-libs
    • 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();
         }
      }
      /*==================================================================*/

            amfowler Anne Fowler (Inactive)
            gaurisha Gauri Sharma (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: