• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Usage of awt components

 
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
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • 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
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic