[Swing] Can swing look sexy?

I want to make more of a UI based program but I don’t know what to use to make the UI.

I was going to use Slick2D since I knew it already except I don’t want to have to code my own text boxes from scratch.

So, then I though: OOOOH Maybe I could use Swing. (Since I already have a little experience in it)

But then I started thinking about Swing and I started to worry about how they look so boring and formal.

So, my question is how do you make Swing sexy? How do you give it your own style instead of it’s boring and basic style it has now? Or can I even use Swing at all?

Take a look here: http://www.javasoft.de/synthetica/themes/

Cas :slight_smile:

To expand on what princec hinted at, Swing supports different Look and Feels, which can customize the, uh, look and feel of your interface. The default Look and Feel of Swing is pretty flat, and in fact the Java developers suggest you at least use the Nimbus Look and Feel, which comes standard with every version of Java after 6u10. The only reason they didn’t change the default is to preserve backwards compatibility.

There are a bunch of downloadable Look and Feels, and you can even create your own!

Edit: You might also want to check out a book called Filthy Rich Clients by Romain Guy and Chet Haase.

Instead of Swing you could also use JavaFX, there you could even do some 3D Graphics an such.
And you can style your GUI like you want with Cascading Style Sheets. :wink:
A easy start would be this tutorial :point:

I actually think that Oracle wants JavaFX to replace Swing someday… in every Swing-Tutorial there’s something about learning JavaFX.

Agreed. Although hopefully Oracle treats JavaFX better than they’ve treated the rest of client-side Java!

I have no idea why you would even want to use Swing for your game’s GUI.

  • Jev

He said he wanted to make a GUI program, not a game.

Sure. Another example is the original libGDX project setup tool, it’s Swing.

So is the new libGDX setup tool: https://github.com/libgdx/libgdx/blob/master/extensions/gdx-setup/src/com/badlogic/gdx/setup/GdxSetupUI.java

is javafx a standard part of the jdk now ?

Yup. “As of JDK 7u6 JavaFX is included with the standard JDK and JRE bundles.”

I must learn JavaFX… making GUIs in OpenGL and strangely designed XML is getting less and less appealing…

Cas :slight_smile:

I’ve always liked Substance:

http://insubstantial.github.io/insubstantial/substance/see.html

Different skins, easy to use and it looks and animates incredibly slick.

JavaFX is nice for that, but to be honest I don’t think there’s really a future for JavaFX.

JavaFX was originally designed for rich web applications, but there’s really no point in going there anymore.
So both Swing and JavaFX are for desktop applications now, and while JavaFX has the potential to make things look very slick, being slick and sexy is usually not really what you want from a desktop GUI.

I’ve done a few projects with JavaFX, and there is a lot to say for it (I think it’s quite well designed), but at the end of the day I still prefer Swing.
And I even prefer Swing with plain Metal L&F (and I probably tested all 3rd party L&Fs). It’s clean and fast, and can still look quite slick. Especially if you put a little effort in to set a nice font, remove the ugly borders, enable AA in custom components etc.
The main problem I had with JavaFX is that it might enable slick ‘web-like’ looking stuff relatively easily, but Swing always felt much more responsive in more complex GUIs.

Desktop applications typically need to be totally responsive, clean and productive, and I think being ‘sexy’ usually doesn’t make a whole lot of sense there.
OTOH if you’re making GUI-heavy game for the desktop (or some other desktop application that needs to look exotic) for whatever reason and you don’t want to go OpenGL, JavaFX might still be a better option though.

The fact that you can deploy JavaFX to desktop, Android, and iOS is pretty exciting for the future of the project. Not everything has to be a web app.

I agree with the first half, but not the second half. Applications also have to be “engaging” and “intuitive”, both of which roughly translate into “sexy”.

Desktop apps are sexy. Example: latest Autodesk Maya, 3ds Max and all of the Adobe Creative Suite

I think we’re debating semantics here.

I agree applications have to be engaging and intuitive most of all, but I took “sexy” to mean things like “cool graphics and animations”.
“Engaging and intuitive” means something else to me (even if there is some overlap). To me that mostly means “going from idea to result as best as possible”.
Cool graphics and animations isn’t the most important thing there, but the feeling of having an application that is focused to enable your ideas is.
To me Swing (or SWT) just works better there on the desktop, but YMMV.

Sigh… :-X

It’s improved vastly in the last 7 days since I finally, after 10 years, got around to hot-updatable XML/textures/shaders/etc. We can just edit files and bingo! They update instantly in the game. That’s rather nice. Could still do with a visual UI editor though. And a Spine importer…

Cas :slight_smile:

JavaFX is basically a Swing competitor… It was publicized as a Web-centric RIA platform, which was a failure, but the technology itself isn’t tied to the web in any way.

I don’t believe this at all.

Swing and JavaFX are widget frameworks with data grids and buttons and checkboxes; that really doesn’t make sense for the majority of games.

If you are making some odd game that uses lots of checkboxes and radio buttons and data app GUI stuff, then sure, go for it, but otherwise, you should use a more appropriate tool.