Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I dont think I may use AWT.

 
Yucca Nel
Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 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
Posts: 516
  • Mark post as helpful
  • send pies
  • 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 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
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic