I know a while ago I asked about this line of the instructions: "[The User Interface] must be composed exclusively with components from the Java Foundation Classes (Swing components)." I was told this means that I should not use a .awt component if a .swing component exists. I did not see any Swing components that could be used instead of what I used, but I thought I would run it by you guys here to make sure I have not imported something to use in my classes that should not be. The events and layouts are no doubt good to go, but I wanted to check on Dimension, Toolkit, and Window.
Matt Pavlovich wrote:I did not see any Swing components that could be used instead of what I used
Did you not use JTextField, JLabel, JButton,...?
Matt Pavlovich wrote:The events and layouts are no doubt good to go, but I wanted to check on Dimension, Toolkit, and Window.
Did you check the javadoc of these classes? That's what we have to do too e.g. Window. This class has a subclass JWindow (so you know that's a swing class). In one of my utility methods I used Window (because you should use the most general class (even better would be an interface) when possible.
And just to complement what's been said here, you are allowed to use AWT components/classes as long as there isn't a corresponding one in the Swing framework. One example is the java.awt.event.ActionListener class.
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
posted 9 years ago
Yes, the JWindow was right in front of my face... And not to worry, Roel, I did use JButton, JTextField, etc.
Its all clear now...thanks guys.
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!