I've just reported this at the JDC.  It seems to be specific to Linux,
and affects both the Blackdown and Sun versions of 1.3.1.

Ron

...
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

Compile and run the enclosed program.  It creates a JFrame containing a
button.  The first time the button is pressed a JDialog is created
containing a cancel button.  Pressing the cancel button hides the
JDialog.  Pressing the button in the JFrame again shows the JDialog.
This works as expected on all platforms and versions of Java that I've
tried (including 1.4.0beta2 on Linux), except on Linux with Java 1.3.1
and 1.3.1_01.  In these versions the JDialog is iconified when it
reappears.

import javax.swing.*;
import java.awt.event.*;

public class DialogBug extends JFrame {
  JDialog dialog ; 

  public DialogBug() { 
    super("DialogBug") ;

    JButton button = new JButton("Press me") ;
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if ( dialog == null ) {
          dialog = new MyDialog(DialogBug.this) ;
        }
        dialog.setVisible(true) ;
      }});

    getContentPane().add(button) ;
    pack() ;
    show() ;
  } 

  public static void main(String[] args) { 
    new DialogBug() ;
  } 

  private class MyDialog extends JDialog { 
    public MyDialog(JFrame frame) {
      super(frame, "Dialog") ;

      JButton cancel = new JButton("Cancel") ;
      cancel.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          MyDialog.this.setVisible(false) ;
        }});

      getContentPane().add(cancel, "Center") ;
      pack() ;
    }
  } 
}


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to