Thursday, March 31, 2011

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.

From stackoverflow
  • 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.

    R. Bemrose : Ugh, ANOTHER new default look for Swing? Granted, the 1.4 (purple) look was ugly, but the 1.5 look wasn't that bad, nor was the 6 look.
  • Swing is the way to go. It's a cleaner programming interface, and looks better.

    Ryan Graham : It's also lighter on resources because of how it was designed.
  • 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.

    artificialidiot : I guess by "multiple platforms" you mean non-desktop platforms.
    yx : yes (10 characters)
  • 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.

  • If you are looking for a better looking GUI, you can have a look at substance look and feel package in this address: https://substance.dev.java.net/see.html

    Gnoupi : True, but not really answering the question.

0 comments:

Post a Comment