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

a Window(Frame) fails to Hide() on X-Win gimp-panel context switch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs
    • x86
    • linux, linux_redhat_9.0

      Name: rmT116609 Date: 05/20/2004


      FULL PRODUCT VERSION :
      ava version "1.5.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux MyLaptop 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      using XWin/gimp with 8 user selectable/switchable panels.

      A DESCRIPTION OF THE PROBLEM :
      the new Window( Frame ) does not disappear ( hide(), setVisible(false) ) when I select a different X Windows Gimp Panel to work on. A windown with a Frame() disappears when i context switch between gimp panels. But the Window(Frame) is painted on each of the Gimp Panels.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run program.
      Select the "press this button" painted on the top left of the screen
      a row of buttons will be painted at location(200,200);

      Now switch working Gimp panels. The press this button disappears. The row of 10 buttons appear on each of the gimp panels.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      At first I though I had to do something to catch a Window event, and do something appropriate. But I saw that 1.4, and 1.3 both java panels disappeared when I context switched between gimp panels.

      Now I expect that both java panels should have disappeared.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /*
       * FloatFrame.java
       *
       * Created on May 19, 2004, 1:46 PM
       */

      /**
       *
       * @author gat
       */
      import java.awt.*;

      public class FloatFrame extends java.awt.Frame {
          
          /** Creates new form FloatFrame */
          public FloatFrame() {
              initComponents();
          }
          
          /** This method is called from within the constructor to
           * initialize the form.
           * WARNING: Do NOT modify this code. The content of this method is
           * always regenerated by the Form Editor.
           */
          private void initComponents() {//GEN-BEGIN:initComponents
              button1 = new java.awt.Button();

              addWindowListener(new java.awt.event.WindowAdapter() {
                  public void windowClosing(java.awt.event.WindowEvent evt) {
                      exitForm(evt);
                  }
              });

              button1.setLabel("Press This Button");
              button1.addMouseListener(new java.awt.event.MouseAdapter() {
                  public void mouseClicked(java.awt.event.MouseEvent evt) {
                      button1MouseClicked(evt);
                  }
              });

              add(button1, java.awt.BorderLayout.CENTER);

              pack();
          }//GEN-END:initComponents

          private void button1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_button1MouseClicked
              // Add your handling code here:
              Frame f = null;
              Component t = evt.getComponent();
              Window win;
              System.out.println("button1MouseClicked");
              while ( ( t = t.getParent() ) != null ) {
                  if ( t instanceof Frame )
                      f = (Frame) t;
              }
              if ( f == null )
                  return;
              System.out.println("button1MouseClicked: 4");
              win = new Window( f );
              Panel p = new panel();
              win.add( p );
              win.setSize( 200, 200 );
              win.setLocation( 200,200 );
              win.pack();
              win.show();
          }//GEN-LAST:event_button1MouseClicked
          
          /** Exit the Application */
          private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
              System.exit(0);
          }//GEN-LAST:event_exitForm
          
          /**
           * @param args the command line arguments
           */
          public static void main(String args[]) {
              new FloatFrame().show();
          }
          
          
          // Variables declaration - do not modify//GEN-BEGIN:variables
          private java.awt.Button button1;
          // End of variables declaration//GEN-END:variables
          
      }


      class panel extends java.awt.Panel {
          
          panel() {
              for ( int i =0; i < 10; i++ )
                  add( new Button( "B"+i ) );
          }
      }
      ---------- END SOURCE ----------
      (Incident Review ID: 270432)
      ======================================================================

            yan Yuri Nesterenko
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: