File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes I dont think I may use AWT. 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 "I dont think I may use AWT. " Watch "I dont think I may use AWT. " New topic
Author

I dont think I may use AWT.

Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

Heres what I am told to do.

It must be composed exclusively with components from the Java Foundation Classes (Swing components). But for future reference to others there are the new layoutStyle
which are part of the JFC. We are allowed to JComponents?

link ..... webpage


SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Yucca Nel wrote:Heres what I am told to do.

It must be composed exclusively with components from the Java Foundation Classes (Swing components). But for future reference to others there are the new layoutStyle
which are part of the JFC. We are allowed to JComponents?

link ..... webpage


You're still allowed to use classes which have no equivalent under swing... For example, ActionListener is under java.awt.event... There are no equivalent with swing package and thus you are allowed to use it.
What would be wrong is to use something like Button under awt while JButton is available. Pretty much all GUI "visual component" (button, dropdown, menu...) must be SWING.. on the other hand, Event objects are in awt.

Regards,
Alex
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Yucca Nel wrote:But for future reference to others there are the new layoutStyle
which are part of the JFC. We are allowed to JComponents?

Hi,

What's wrong with JComponent ? It is a swing class alright and the same thing for LayoutStyle..
Care to explain why this could be forbidden ? (I'm willing to accept I might be wrong ;)

Alex
Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

I am very confused. I am told to only use JFC classes. AWT does not fall under JFC. Am I allowed to use AWTimension and AWT.Tookit? About the Jcomponent thing I was not sure if it fell under the same category as J2EE which is just my speculation. Are we allowed to use JUnit?
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Yucca Nel wrote:I am very confused. I am told to only use JFC classes. AWT does not fall under JFC. Am I allowed to use AWTimension and AWT.Tookit? About the Jcomponent thing I was not sure if it fell under the same category as J2EE which is just my speculation. Are we allowed to use JUnit?


My advice would be not to over complicate the GUI anyway, so you shouldn't anything too fancy.. I'm not sure about Dimension and Toolkit..
I'll let another rancher give his opinion on this..

You are of course allowed to use JUnit.. I simply did not deliver my junit test classes to SUN..
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2353
    
    7

Hi Yucca,

Most of Swing components are on top (inherit from) of AWT. So technically the very low level is AWT.

As for your question about whether to use Toolkit and Dimension to position your window... I did it in my project. I use Toolkit to get user's screen size (a Dimension) then calculate the window's X and Y position on screen passing in a Rectangle (which indeed in AWT not Swing).

Even the commonly used layout managers (eg Flow, Border etc) are in AWT. So how possibly can you not use AWT to support your Swing GUI?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I dont think I may use AWT.