views:

31

answers:

4

Where can i find a good guide for using the java.awt package? I'm relatively new to java.

+2  A: 

Sun's website has an AWT guide, but odds are you actually want to use Swing, which essentially replaced AWT some time ago

Michael Mrozek
what is this Swing of which you speak?
David
+1  A: 

Here are 2 links that seems to be quite good starting point: http://java.sun.com/developer/onlineTraining/awt/contents.html

http://www.eng.auburn.edu/~rayh/java/java/AWT.Tutorial.html

Good luck :)

duduamar
A: 

Michael is right, you definitely want to be looking at Swing.

A general overview is here: http://en.wikipedia.org/wiki/Swing_%28Java%29

For the purposes of completeness, another widely used GUI toolkit is SWT, the Standard Widget Toolkit from IBM: http://en.wikipedia.org/wiki/Standard_Widget_Toolkit

But you probably want Swing.

Gordon Christie
A: 

AWT is old. I mean, really old.

Swing is the "modern" UI included with Java itself these days. It creates its own widgets rather than using the ones provided by the operating system.

Swing has three major classes of look and feels that you can select using javax.swing.UIManager.setLookAndFeel(String className):

  1. The Cross-platform look and feel. This is the default look and feel. It looks relatively the same on all platforms for a given version of Java. Its name is returned by the function javax.swing.UIManager.getCrossPlatformLookAndFeelClassName();
  2. The Platform native look and feel. This looks different depending on which OS is being used. The current platform's name is returned by javax.swing.UIManager.getSystemLookAndFeelClassName();
  3. The Synth look and feel. This looks the same on all platforms, but is drawn using vector graphics. Java ships with the Nimbus (synth-based) look and feel in 6u10 and newer.

The other major alternative is SWT. SWT is the Eclipse project's wrapper around the OS's native widgets, originally spearheaded by IBM.

R. Bemrose