[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
JDialog weirdness - what to do?
From: |
Robert Schuster |
Subject: |
JDialog weirdness - what to do? |
Date: |
Fri, 04 Mar 2005 01:57:53 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.5) Gecko/20050107 |
Hi list,
I just found out the following & got a headache from it:
GNU Classpath's JDialog rejects illegal values given to the method
setDefaultCloseOperation() with a IllegalArgumentException. This is good
for robustness but it is not what the official implementation does :-(
The official JDialog takes any argument (whether legal or not) and does
not complain. That means for any int value n, after the call to
dialog.setDefaultCloseOperation(n) the result of the corresponding
getter is n.
The behavior when you actually press the close button is as if you had
set the operation to DO_NOTHING_ON_CLOSE. Btw. the default value for
getDefaultCloseOperation() is HIDE_ON_CLOSE (this is documented at least).
Eg. if you have a JDialog and set it's default close operation to
JDialog.EXIT_ON_CLOSE getDefaultCloseOperation() will return exactly
this value but does not act in this way.
Now, I have two questions:
1) Who codes such crap and are we really really forced to adopt this? (I
propose setting the value to DO_NOTHING_ON_CLOSE if the argument is
invalid. )
2) How could I test in mauve whether pressing the close button of a
JDialog has no effect?
cu
Robert
- JDialog weirdness - what to do?,
Robert Schuster <=