12

I have been mucking about with Java swing lately but it's butt ugly! Are most people who write Java GUI's using swing or something else? I would really appreciate a recommendation. I don't want to use a GUI builder because I need to learn how everything works first.

Thanks!

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
james
  • 3,543
  • 8
  • 31
  • 39
  • well Swing feels very verbose like everything else Java, but mostly GUI ugly. – james Dec 16 '10 at 15:00
  • 2
    If you think ALL of the look-and-feel styles of Swing are ugly (have you tried them all? Did you know they were there?) then you can always write your own. Swing lets you do that. – DJClayworth Dec 16 '10 at 15:59
  • 1
    I would recommend sticking to Swing for portability reasons. Also note that if you use anything else, your users will probably need to install that something which is a pain. – Sergei Tachenov Dec 16 '10 at 16:02
  • 3
    For Swing, consider using the [Nimbus](http://download.oracle.com/javase/6/docs/technotes/guides/jweb/otherFeatures/nimbus_laf.html) look and feel if it's Java 6.10 or newer. – Powerlord Dec 16 '10 at 16:55

8 Answers8

11

If you don't like the default Swing look'n'feel, you can change it ; many ready-built themes exist. And it is quite possible to build beautiful and ergonomic applications with Swing : take a look at Netbeans or IntelliJ.

But if you definitely want to use another graphic toolkit, you can try SWT. Contrary to Swing that is pure Java, SWT uses native controls as much as possible (those provided by your OS), and emulates the missing ones. It was developed for, and is used by, the Eclipse platform.

Olivier Croisier
  • 6,139
  • 25
  • 34
10

Most people use Swing.

Some use SWT, but you have to dispose object after use. (no auto dispose in Garbage collecting) It give very native look UI.

Some use Qt-Jambi, but then you have to understand some C++ code. Most of them are for interoperating with Qt.

Some ancient code use AWT. Most of them are for legacy reason. I recommend avoid it.

J-16 SDiZ
  • 26,473
  • 4
  • 65
  • 84
5

I have been mucking about with Java swing lately but it's butt ugly!

try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {}

Are most people who write Java GUI's using swing

For most things, yes. It's built-in, and doesn't suck that bad for a cross-platform GUI library (which all suck to some extent).

Mud
  • 28,277
  • 11
  • 59
  • 92
4

By the way, Swing's Look and Feel can be customized. There are some pretty good LaFs. See here how to change the look and feel.

Check this question for how to change the look and feel and for a list of nice look and feels

Community
  • 1
  • 1
Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
2

SWT is very good. It tries to use native GUI drawing functions wherever possible. An example of application written with SWT is Eclipse IDE.

http://www.eclipse.org/swt/

bezmax
  • 25,562
  • 10
  • 53
  • 84
1

you can use native look and feel with swing, thus it's less ugly. Personnally, I use swing for my GUIs in java, and I find it quite straight forward and documented.

Here is a link toward swing documentation:

http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

yohann.martineau
  • 1,523
  • 1
  • 17
  • 24
1

The only thing is ugly in Swing is standart layout manages. They are or too primitive or too complicated. If you really want to write nice gui without gui builders take a look at alternative layout managers. For example Table layout https://tablelayout.dev.java.net/

NullPointer
  • 924
  • 14
  • 27
0

Look to SWT http://www.eclipse.org/swt/ - Eclipse entirely built on it.

Barmaley
  • 16,638
  • 18
  • 73
  • 146