• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usage of awt components

 
Stan Griffith
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

My assignement has the following statement.


The user interface for this assignment must satisfy the following criteria:

It must be composed exclusively with components from the Java Foundation Classes (Swing components).


Does this mean that I can not use awt features like Font, Color? Infact all the layouts are from awt package.

Thanks

Stan
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stan,

That instruction means that you cannot use any component from the AWT package for which there is a replacement in the Swing package. So you cannot use a Button since there is a JButton component.

Does this mean that I can not use awt features like Font, Color? Infact all the layouts are from awt package.
Yes, they are all from the java.awt package, but none of them are java.awt.Components.

Personally I suspect that the prohibition on using ant AWT Component was suggested at the time that the SCJP exam required candidates to know what was a java.awt.Component and what wasnt (boy, wasn't that fun :roll: ). Since candidates who passed SCJP 1.4 or SCJP 1.5 no longer need to know that class heirachy, the restriction on using ant AWT Component(s) only seems to confuse people. In fact, I am adding this to the FAQ now ...

Regards, Andrew
 
Stan Griffith
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Andrew. I take it that it is ok to use classes like Font, Color and layouts like FlowLayout and BorderLayout.

regards

Stan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic