Does anyone like the way Swing programs look?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

fictiveLaark
Posts: 31
Joined: Tue Mar 16, 2010 3:57 am UTC

Does anyone like the way Swing programs look?

Postby fictiveLaark » Mon Dec 13, 2010 5:21 am UTC

I guess on account that Swing programs don't have the same look and feel as your OS(though that's only by default.) Many people seem to think it's a hideous abomination. But I really like it, maybe because I've been looking at them for a long time now.

User avatar
sourmìlk
If I can't complain, can I at least express my fear?
Posts: 6393
Joined: Mon Dec 22, 2008 10:53 pm UTC
Location: permanently in the wrong
Contact:

Re: Does anyone like the way Swing programs look?

Postby sourmìlk » Mon Dec 13, 2010 5:40 am UTC

I don't like it, and there is virtually no excuse for making a swing UI. If you need a cross platform swing-style GUI that also conforms to the operating system's appearance, make it web-based.
Terry Pratchett wrote:The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.

User avatar
hotaru
Posts: 1045
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Does anyone like the way Swing programs look?

Postby hotaru » Mon Dec 13, 2010 7:39 am UTC

there's also the fact that swing is slow and uses huge amounts of memory. every time i see something that looks like swing, i think "oh great, i'm not going to be able to do anything on this computer for about 10 minutes". maybe if it weren't for that, i wouldn't hate that look so much.

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

User avatar
jaap
Posts: 2094
Joined: Fri Jul 06, 2007 7:06 am UTC
Contact:

Re: Does anyone like the way Swing programs look?

Postby jaap » Mon Dec 13, 2010 10:33 am UTC

It is possible to set the look-and-feel of Swing, for example to the default of the OS to make it look native. This only works if you do this near the start of the program before any of the Swing classes are instantiated.

keeperofdakeys
Posts: 658
Joined: Wed Oct 01, 2008 6:04 am UTC

Re: Does anyone like the way Swing programs look?

Postby keeperofdakeys » Mon Dec 13, 2010 1:58 pm UTC

jaap wrote:It is possible to set the look-and-feel of Swing, for example to the default of the OS to make it look native. This only works if you do this near the start of the program before any of the Swing classes are instantiated.

If you've ever used swing on a mac, the look and feel is done by the mac java vm.

User avatar
RebeccaRGB
Posts: 336
Joined: Sat Mar 06, 2010 7:36 am UTC
Location: Lesbians Love Bluetooth
Contact:

Re: Does anyone like the way Swing programs look?

Postby RebeccaRGB » Wed Dec 15, 2010 7:28 am UTC

Put this code at the start of your main function, and your Swing apps won't look like crap will look like the native OS:

Code: Select all

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


It took me a bit of searching to find that, and I don't remember where.

No, I don't like the default Swing look, because it stands out too much; it just doesn't look like anything else you'll ever see.
Stephen Hawking: Great. The entire universe was destroyed.
Fry: Destroyed? Then where are we now?
Al Gore: I don't know. But I can darn well tell you where we're not—the universe!

User avatar
Emu*
Posts: 689
Joined: Mon Apr 28, 2008 9:47 am UTC
Location: Cardiff, UK
Contact:

Re: Does anyone like the way Swing programs look?

Postby Emu* » Thu Dec 16, 2010 1:29 pm UTC

RebeccaRGB wrote:it just doesn't look like anything else you'll ever see if you've never used anything but MacOS and Windows.


FTFY
Cosmologicon wrote:Emu* implemented a naive east-first strategy and ran it for an hour, producing results that rivaled many sophisticated strategies, visiting 614 cells. For this, Emu* is awarded Best Deterministic Algorithm!

archeleus
Posts: 240
Joined: Wed Sep 29, 2010 1:49 pm UTC
Location: Valenvaryon
Contact:

Re: Does anyone like the way Swing programs look?

Postby archeleus » Thu Dec 16, 2010 2:05 pm UTC

No, I can't stand the look either. On the mac it isn't so bad, but otherwise I avoid it as much as possible.

If I'm on a low end system then yes I think along the same lines
hotaru wrote:oh great, i'm not going to be able to do anything on this computer for about 10 minutes
I write a blog rant here.

User avatar
RebeccaRGB
Posts: 336
Joined: Sat Mar 06, 2010 7:36 am UTC
Location: Lesbians Love Bluetooth
Contact:

Re: Does anyone like the way Swing programs look?

Postby RebeccaRGB » Thu Dec 16, 2010 3:13 pm UTC

Emu* wrote:
RebeccaRGB wrote:it just doesn't look like anything else you'll ever see if you've never used anything but MacOS and Windows.

FTFY

KDE doesn't look a thing like Metal. GNOME doesn't look a thing like Metal. Motif doesn't look a thing like Metal. GEOS doesn't look a thing like Metal. BeOS doesn't look a thing like Metal. So please enlighten me; what does?
Stephen Hawking: Great. The entire universe was destroyed.
Fry: Destroyed? Then where are we now?
Al Gore: I don't know. But I can darn well tell you where we're not—the universe!

0xBADFEED
Posts: 687
Joined: Mon May 05, 2008 2:14 am UTC

Re: Does anyone like the way Swing programs look?

Postby 0xBADFEED » Thu Dec 16, 2010 3:29 pm UTC

sourmìlk wrote:I don't like it, and there is virtually no excuse for making a swing UI. If you need a cross platform swing-style GUI that also conforms to the operating system's appearance, make it web-based.

There are tons of reasons that a Swing UI might be justified. Sure there are better looking cross-platform toolkits. But the fact that Swing is included in the standard library is a huge win. And there are lots of applications that just aren't suitable as webapps. For example, if you're slapping a front-end on a large existing Java code-base I would say Swing is a completely reasonable choice. It makes a lot more sense to code up a simple Swing UI than it does to introduce an HTTP server, possibly 2-3 new languages, and an entire web-stack to the project.

hotaru wrote:there's also the fact that swing is slow and uses huge amounts of memory.

This hasn't been true for quite some time. Or at least I haven't seen it to be true for quite some time. I've written several large Swing UI's that are plenty snappy on older hardware. And really the 2D back-end of Swing is quite impressive from a performance standpoint (for what it is). There's lots of shit software that (mis)uses Swing. Those apps tend to be slow. Although at this point I think that's more correlation than causation. Swing is more complicated than most other UI toolkits I've used and therefor easy to get wrong and wind up with a slow lumbering UI. But I don't think the slowness is a fundamental property of Swing.

Also there are some third-party LAF's out there that mitigate the ugliness of it.

RebeccaRGB wrote:KDE doesn't look a thing like Metal. GNOME doesn't look a thing like Metal. Motif doesn't look a thing like Metal. GEOS doesn't look a thing like Metal. BeOS doesn't look a thing like Metal. So please enlighten me; what does?

The Metal LAF looks (to me) very similar to CDE (Motif). But it's not supposed to look like anything, that's the point, it's the Swing LAF. But the look of it is reminiscent of older Unixy UI's which I think is the point he was making.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 10 guests