bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/22981] swing: javax.swing.JInternalFrame.setDefaultCloseO


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22981] swing: javax.swing.JInternalFrame.setDefaultCloseOperation(EXIT_ON_CLOSE) not handled
Date: 16 Oct 2005 01:27:51 -0000

Steps to reproduce:
1. Run the attached testcase.

Expected results:
1. Program exits sucessfully

Actual results:
1. Following exception is thrown:
java.lang.Error: Close operation must be one of DO_NOTHING_ON_CLOSE,
HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
   at javax.swing.JInternalFrame.setDefaultCloseOperation
(JInternalFrame.java:1291)
   at testcase.<init> (testcase.java:8)
   at testcase.main (testcase.java:5)


Testcase:
import javax.swing.*;
import java.awt.*;
public class testcase extends JInternalFrame {
        public static void main(String[] args) {
                (new testcase()).show();
        }
        public testcase() {
                setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        }
}


------- Comment #1 from from-classpath at savannah dot gnu dot org  2005-06-16 
17:53 -------
Why is this an error?  I don't believe EXIT_ON_CLOSE is valid for
JInternalFrame.

EXIT_ON_CLOSE is specific to JFrames.


------- Comment #2 from from-classpath at savannah dot gnu dot org  2005-06-16 
19:16 -------
I have seen something similar in JDialog and or JFrame. Invalid values should
not throw an exception but should instead be swallowed and lead to the default
behaviour, AFAICR.


------- Comment #3 from from-classpath at savannah dot gnu dot org  2005-06-24 
09:17 -------
No exception seems to be thrown anymore.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22981





reply via email to

[Prev in Thread] Current Thread [Next in Thread]