-
Bug
-
Resolution: Unresolved
-
P4
-
1.4.2, 5.0, 6, 7, 8, 9, 10, 11, 12, 13, 14
-
generic
-
generic
As per the specification, FileDialog extends Dialog. But practically none of the parent class's methods are usable with FileDialog. For example, some of the behaviors are given below:
1. Adding a component to FileDialog using add() method. This throws a NPE on Win32 platforms and works fine on Linux/Solaris. But on linux / solaris with XToolkit, component is getting added to some arbitrary location in file dialog. However this is not a supported operation and hence must either be restricted by throwing an UnsupportedOperationException or must be specified in the spec.
Here is the exception:
java.lang.NullPointerException: null pData
at sun.awt.windows.WButtonPeer.create(Native Method)
2. Calling FileDialog.setLayout() throws the same exception on Win32. Does not have any effect on Sol/Linux.
3. Popping up another dialog with FileDialog as the parent throws an OutOfMemory error on win32. Works fine on Solaris/Linux.
4. setSize() method in Dialog - this is ignored on win32 but honored on solaris/linux (xtoolkit) only for the second time. First time the dialog is shown with the default size of 400 x 400. Either the size must be honored consistently regardless of how many times the dialog is shown or calling this method should throw an UnsupportedOperationException. Or the specification must say that this an unsupported method for FileDialog.
Likewise, there are many other methods that are inherited by the file dialog from it's parents but none of them work with FileDialog. We must clarify our spec to clearly say what is expected to work with FD and what is not. This way we can avoid some of the unpredictable behaviors explained above.
1. Adding a component to FileDialog using add() method. This throws a NPE on Win32 platforms and works fine on Linux/Solaris. But on linux / solaris with XToolkit, component is getting added to some arbitrary location in file dialog. However this is not a supported operation and hence must either be restricted by throwing an UnsupportedOperationException or must be specified in the spec.
Here is the exception:
java.lang.NullPointerException: null pData
at sun.awt.windows.WButtonPeer.create(Native Method)
2. Calling FileDialog.setLayout() throws the same exception on Win32. Does not have any effect on Sol/Linux.
3. Popping up another dialog with FileDialog as the parent throws an OutOfMemory error on win32. Works fine on Solaris/Linux.
4. setSize() method in Dialog - this is ignored on win32 but honored on solaris/linux (xtoolkit) only for the second time. First time the dialog is shown with the default size of 400 x 400. Either the size must be honored consistently regardless of how many times the dialog is shown or calling this method should throw an UnsupportedOperationException. Or the specification must say that this an unsupported method for FileDialog.
Likewise, there are many other methods that are inherited by the file dialog from it's parents but none of them work with FileDialog. We must clarify our spec to clearly say what is expected to work with FD and what is not. This way we can avoid some of the unpredictable behaviors explained above.
- relates to
-
JDK-5097242 REG: File dialog size becomes small when bringing up for the second time, XTlkt
- Closed