aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes About Swing components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "About Swing components" Watch "About Swing components" New topic
Author

About Swing components

Ailsa Cape
Ranch Hand

Joined: Aug 10, 2005
Posts: 92
Hi, everyone.

When I use the javadoc tool to generate documents API, I find the class hierarchy of JFrame.

This question may be silly, but I am a bit confused. The JFrame class does derive from the java.awt.Component and also be in the swing package. Furthermore, in the JFrame class there are many fields and hundreds of methods which directly inherit from java.awt.Component. But my instructions state that "It must be composed exclusively with components from the Java Foundation Classes (Swing components)" and I have read the FAQ, "If a class does not inherit from the java.awt.Component, you can use it". So, can I use the JFrame class?

Thanks in advance!
Regards, Ailsa Cape
[ September 19, 2005: Message edited by: Ailsa Cape ]
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

Hi Ailsa,

It looks like we need to update the FAQ - care to do it?

Basically you should not use any AWT component for which there is a Swing replacement. So in the example you have given, you should not use a Frame (AWT) because there is a JFrame (Swing).

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Ailsa Cape
Ranch Hand

Joined: Aug 10, 2005
Posts: 92
Hi, Andrew

Thank you again for clarifying this ambiguous issue.
This item in the instructions seems to confuse people deliberately. Now I think what the instructions want to say is just you have pointed out,

Basically you should not use any AWT component for which there is a Swing replacement.



Best Regards, Ailsa Cape
 
Consider Paul's rocket mass heater.
 
subject: About Swing components