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

Modal dialogs displayed second time gets minimized on task bar (Linux only)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.3.1_03
    • Fix Version/s: 1.3.1_05
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      05
    • CPU:
      x86
    • OS:
      linux_redhat_7.2

      Description

      Customer Problem Description:
      ----------------------------

      JDK 1.3.1_03
      Redhat Linux 7.3 with Gnome user environment


      Modal dialogs display properly the first time they are shown. If the
      dialog is dismissed, and then show is called on the same dialog, you have
      to go to the task bar to make the dialog appear.

      This problem is not happening on Windows or Solaris.

      A small sample program to demonstrate the problem is included below.

      public class ModalTest extends javax.swing.JFrame
          implements java.awt.event.ActionListener
      {
          public static void main( String[] args )
          {
              ModalTest modalTest = new ModalTest();
          }

          public ModalTest()
          {
              super();

              setTitle( "Modal Dialog Test" );

              setResizable( true );

              java.awt.Container contentPane = getContentPane();

              java.awt.GridBagLayout layout = new java.awt.GridBagLayout();
              contentPane.setLayout( layout );
              java.awt.GridBagConstraints layoutConstraints;
              contentPane.add( _showModalDialogButton );

              _showModalDialogButton.addActionListener
      ((java.awt.event.ActionListener)this);

              _showModalDialogButton.setText( "Show Modal Dialog" );

              layoutConstraints = new java.awt.GridBagConstraints();
              layoutConstraints.gridx = 0;
              layoutConstraints.gridy = 0;
              layout.setConstraints( _showModalDialogButton, layoutConstraints );

              pack();
              show();
          }

          public void actionPerformed( java.awt.event.ActionEvent event )
          {
              java.lang.Object eventTarget = event.getSource();
              if( eventTarget == _showModalDialogButton ) {
                  if( _modalDialog == null ) {
                      _modalDialog = new ModalDialog( this );
                  }
                  _modalDialog.setVisible( true );
              }
          }


          javax.swing.JButton _showModalDialogButton = new javax.swing.JButton();
          ModalDialog _modalDialog;
      }

      class ModalDialog extends javax.swing.JDialog
      {
          public ModalDialog( java.awt.Frame parent )
          {
              super( parent,true );

              setTitle( "Modal Dialog" );

              setResizable( true );

              java.awt.Container contentPane = getContentPane();

              java.awt.GridBagLayout layout = new java.awt.GridBagLayout();
              contentPane.setLayout( layout );
              java.awt.GridBagConstraints layoutConstraints;
              contentPane.add( _helloLabel );

              _helloLabel.setText( "Hello" );

              layoutConstraints = new java.awt.GridBagConstraints();
              layoutConstraints.gridx = 0;
              layoutConstraints.gridy = 0;
              layout.setConstraints( _helloLabel, layoutConstraints );

              pack();
          }

          protected javax.swing.JLabel _helloLabel = new javax.swing.JLabel();

      }

        Attachments

          Activity

            People

            Assignee:
            duke J. Duke (Inactive)
            Reporter:
            cprasadsunw Ck Prasad (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: