Where can i find a good guide for using the java.awt package? [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this questionWhere can i find a good guide for using the java.awt pa开发者_高级运维ckage? I'm relatively new to java.
Sun's website has an AWT guide, but odds are you actually want to use Swing, which essentially replaced AWT some time ago
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 :)
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.
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)
:
- 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();
- 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();
- 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.
精彩评论