Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

About Swing components  RSS feed

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
author and jackaroo
Posts: 12197
279
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ailsa Cape
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Create symphonies in seed and soil. For this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!