This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
|Summary:||Remove the use of getContentPane()|
|Issue Type:||ENHANCEMENT||Exception Reporter:|
Description alexandros 2008-11-09 14:49:46 UTC
Except for the case that the JDK used is <5.0
Comment 1 Michel Graciano 2008-11-09 15:10:11 UTC
I don't agree about use the JDK used is the correct approach. And if I wish to generate a form to use with JDK 1.4 but I am using JDK 5 in my development environment? Maybe the correct is use the JDK source target project property. Another thing to think is, how to manage it if the user change the JDK version < 5.0? The forms will be regenerated automatically or user need to open ALL the form manually? Think that tools exists to help us to be productive and not to create more problems than we already have. Regards.
Comment 2 Jiri Vagner 2008-11-10 09:23:16 UTC
So, I just opened javadoc for JFrame and I found getContentPane() method there... http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JFrame.html#getContentPane() ... but maybe I just don't understand your troubles. Can you please add more info about yout issue? Please add simple steps to reproduce, sample code, ...
Comment 3 Jan Stola 2008-11-10 10:17:17 UTC
to jvagner: Pre 1.5 JDKs forced you to write JFrame.getContentPane().add(), JFrame.getContentPane().remove(), JFrame.getContentPane().setLayout(). Since JDK 1.5 it is possible to use simple JFrame.add(), JFrame.remove(), JFrame.setLayout().
Comment 4 Jan Stola 2008-11-10 10:20:23 UTC
I agree with hmichel that the right decision when to remove the getContentPane() prefix is not as simple as it seems at the first sight. On the other hand, it is a valid (low priority) request for enhancement that should be considered in the following releases.
Comment 5 Jiri Vagner 2008-11-10 11:26:45 UTC
to jstola: Oups, thanks for explanation.
Comment 6 Michel Graciano 2008-11-10 13:13:58 UTC
Yes, I agree that this is a important thing to be implemented, we just decide how to proceed about things like that. Regards