• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I dont think I may use AWT.

 
Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am very confused. I am told to only use JFC classes. AWT does not fall under JFC. Am I allowed to use AWT:Dimension 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
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 AWT:Dimension 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..
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic