简体   繁体   中英

Java's AWT or Swing for GUI construction?

I need to compose a fairly simple GUI for a server monitoring process. It will have a few tabs which lead to a log tailing, counts of resources, and a start and top control. Nothing fancy here. Which Java framework, AWT or Swing, makes more sense for something this simple.

Swing is the way to go. It's a cleaner programming interface, and looks better.

Use Swing or SWT , since AWT has no tabs built in.

Starting with Java 6 Update 10 , Swing got an entirely new look and feel, the 'Nimbus Look and Feel'. It looks great and is really fast because it uses vector graphics.

Swing is your best choice if you're stuck choosing between Swing and AWT.

If you have the flexibility, I would at least consider SWT . It's faster, matches the platform look and feel, and seems to have fewer porting hurdles and regression problems from release to release. There is a small hurdle in setting up your first project (getting the right jars and such), but other than that, it's no more difficult to work in.

AWT was the first Java GUI framework, it had a lot of flaws and was abandoned in favor of Swing. The main reason it is still in the JDK is for backwards compatibility and because some classes are re-used by Swing.

The future however (even for the desktop) could be JavaFX .

如果您正在寻找更好看的GUI,您可以在这个地址查看实质外观包: https//substance.dev.java.net/see.html

if you are planning to move your gui onto multiple platforms, then go with AWT. Otherwise, Swing gives you a much broader set of components to work with.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM