Skinning Java desktop applications? - java

Does anybody know a way to "skin" Java desktop applications. (Like Winamp skins, or skins for MirandaIM)?
I don't want to create my own look and feel.

Yes, there are a few ways this can be done, but I don't know anyone that is really simple. Have a look at Nimbus: The New Face of Swing, it contains a few examples. You can often override the look of components or just change the colors.
Some links:
Nimbus Colors
Skinning a Slider with Nimbus
Nimbus UIManager UIDefaults
And you can always change to another LaF, in example Substance.

We've successfully used the NimROD Look and Feel to 'skin' the Swing look & feel. It works well, has several 'themes' already written for it, and can be added in a few lines of code.

Swing has built-in dynamic look and feel support. If you are talking about desktop apps, you might want to start with Lesson: Modifying the Look and Feel.
Edit: If you are talking about a webapp, then absolutely use different .css to acheive a skinnable interface. CSS Zen Garden is a great example/tutorial on how the same page can look entirely different with a different .css file.

For a project that's still actively maintained in 2022 and allows skinning of Swing applications try FlatLaf
FlatLaf is a modern open-source cross-platform Look and Feel for Java
Swing desktop applications.
It looks almost flat (no shadows or gradients), clean, simple and
elegant. FlatLaf comes with Light, Dark, IntelliJ and Darcula themes,
scales on HiDPI displays and runs on Java 8 or newer.
The look is heavily inspired by Darcula and IntelliJ themes from
IntelliJ IDEA 2019.2+ and uses almost the same colors and icons.

Another modern look and feel active maintained in 2022 is https://github.com/vincenzopalazzo/material-ui-swing
It include also a way to develop a custom theme in an external jar, like this one https://github.com/material-ui-swing/DarkStackOverflowTheme

Related

How to make Java Swing application developed in NetBeans not have hideous buttons?

I developed a Java application in Netbeans, and I'm going to release it soon so I'm working on making it less ugly. Since I'm developing on a Mac, the GUI builder uses the Mac Look & Feel, which looks decent, but many of my users won't be using Macs. The default L&F is Nimbus, which looks fine except for the buttons, which have annoying borders that are not overridden by the manually setting the borders (you can see how the manual borders look in the image). With the manually set borders, the Nimbus L&F adds its own odd border inside the border I made, which just looks idiotic. Without the manually set borders, Nimbus's borders overlap in visually unappealing ways, and in order to avoid overlap I have to space the buttons really far apart, which I also don't like.
I tried using the other L&Fs available in Netbeans (Metal and something else), but they're just too ugly to stand.
Basically, I would like some advice on how to customize the way buttons look in this application. I don't want to write a button drawing function from scratch or design my own images. I just want a way to change the settings so things don't look stupid. I read in various places that the Substance L&F is good, but I can't find where to download it anywhere. If someone could link me to a download page for Substance or recommend another popular, simple and not stupid-looking L&F, I would greatly appreciate it.
Yeah pretty much all the L&Fs you'll find in Netbeans are worse than the default. The program will use the default Look & Feel of the operating system - so if it's being run on Windows it will have the "Windows-esce" buttons and fonts and on Mac will have the Mac style.
It all depends on what you're looking for. If you're application is meant to be professional and you don't mind it having different styles depending on the OS of the user then I'd leave it as default. It lends familiarity to your program which can truly make the user feel much more comfortable.
If you're after an indetical look for all users then, as you know, you just need to include the L&F with your program. I couldn't find a download for Substance but there are a few L&F's here - both commercial and free.
http://www.java2s.com/Product/Java/Swing/Look-And-Feel-LaF.htm

A better gui design using java

I am planning to develop an java application,so i am in search of some library's that can give a pleasant look and feel and easy to customize.I tried swing but the look and feel is not much i expected and creating a look and feel is not so easy i think (i am not sure). i am from web development. In my previous question Java GUI development alternative to swt or swing most guys recommend javafx and i am working on an 64 bit linux machine and javafx is not available for that. I need some advice ,
Better to create own look and feel library else suggest some good library for look and feel
Note:i tried nimbus look and feel.
I can just give some suggestions that I am using in conjunction with Swing:
JRibbon/Flamingo (Office 2007 like ribbons)
Substance Look and Feel (works very well with JRibbon/Flamingo and is quite configurable, with a lot of predefined skins)
SwingX (additional/extended Swing components)
Note that for Substance there's a fork called Insubstantial which contains also a Flamingo fork named Peacock.
JRibbon is the best replacement for menu and toolbar in a Java application. JRibbon gives a better user experiance then ordinary menubar and toolbar. It is look like rich UI Component in Java. JRibbon has all facility like Microsoft Office Ribbon have like application menu, taskbar.
Source : JRibbon Tutorial

Implementing a simple UI editor in Java

I'm thinking about writing a simple UI designer in Java. I'm just playing with ideas at the moment to see if it is feasible.
It would be good to have something like this as all of our UIs are generated from XML. Just wondering if anyone has tried anything like this before. I know there will be a lot of effort in doing something like this.
Does anyone know of any 3rd party products that already do something like this?
If not then at a simple level, it will have drag and drop support for any component that can be positioned on a panel. Then extra bits will be added. Are there any good samples on the net for this?
Cheers
Dated back to 2005, this has an overview of Java UI Builders:
http://www.fullspan.com/articles/java-gui-builders.html
Here is a page on how to use the Eclipse Visual Editor:
http://www.ibm.com/developerworks/opensource/library/os-ecvisual/
Here is a good page on the different approaches to build UIs in Java:
http://leepoint.net/notes-java/GUI/misc/80gui-generator.html
Which GUI technology are you using? Swing? NetBeans has a very good drag-and-drop Swing GUI editor. For Eclipse there are several plugins.
If you want to see other projects in which a Swing GUI is generated from XML config files, there are different libraries that do this.
Eclipse 4.0 Developer Preview was just released with an xml based toolkit called XWT. It can be styled with CSS and has a GUI builder. This is a developer preview and there will be some changes over the next year as it progresses to release 4.1, but it is useable right now and the community support is really good.

Is it possible to make a visually appealing GUI with JavaFX & Swing?

I would like to do a visually appealing / user-friendly GUI in java. Swing is a limited in terms of "skin" customization. I'm thinking about JavaFX, but I don't get it yet,
what can I achieve with this technology ?
how hard is it ?
do you have examples of real-life examples of Swing/JavaFX integration ?
I would like to do something in this spirit of this, which is built on the .NET framework:
original link: http://www.patrickpayet.com/net/?p=329
edit: is their any getting started overview sample code that I can read to get a general feeling of the work needed to be done to achieve something in the spirit of the screenshot? maybe something like the miglayout's swing demo http://www.migcalendar.com/miglayout/swingdemoapp.jnlp
edit2: I found http://download.java.net/general/openjfx/demos/tutorial.jnlp it's really basic though, linked from http://www.deitel.com/ResourceCenters/Programming/JavaFX/JavaFXTutorialsandDemos/tabid/2187/Default.aspx
Doing such a GUI with JavaFX seems to be rather easy.
For a rapid view on the JavaFX echosystem, I would suggest you to take a look at those sites, showing most of the bleeding edge JavaFX technologies :
Jonathan Giles blog on Swing/JavaFX/Griffon
Dean Iverson blog going more in details about JavaFX components
Amy Fowler blog
And finally, take a look at JavaFX home site samples.
Yes, Swing is very customizable. I recommend reading Filthy Rich Clients.
For an example, have a look at Cezanne L&F.
Swing alone can also create awesome looking UIs. You can explore online for number of plugins and samples to add various features. I'd recommend you go through Romain Guy's Blog & Read his book Filthy Rich Clients. I found this blog really cool.
Swing won't disappoint you.
Swing's L&F can help you in this case.
The traditional way to customize L&F is to write your own UI classes for all components, which is not easy.
The Synth L&F is included in JRE5 and become mature in JRE6. With Synth L&F you can customize your own look and feel with images and painter classes. You can also take a look at this IDE for Synth based L&F.
Also checkout my entry to the JFXStudio challenge last year:
http://jfxstudio.wordpress.com/2009/11/10/challenge-five-winners/
This is a very simple "Video Poker" game written in just less than 3,000 characters (ie 30 lines of code). Note that 90% of the graphical elements are images, which gives you an idea of the scope you have for producing "sexy" UIs.
I'll also add that the main elements of this application were written in one evening. JavaFX is a very powerful tool for UI creation once you get used to it.
Yes, you can do that with JavaFX by writing your own CSS files. Learn more at: JavaFX CSS Documentation
It is actually not that hard if you are familiar with CSS.
you can get colorful original GUI with LookAndFeelMetalizer.
For example phoyo was done with it.

java swing app with a custom titlebar?

Is there a way to write a Java Swing application with a custom chrome? Please take a look* at the frame for Microsoft's Zune 4.0 software.
I realize that colors, the shape of scroll bars, etc. are controlled by skins or looks and feels. Right now I'm trying to tackle the native window which houses the java components--the title bar mainly.
Thanks
(*) http://www.winsupersite.com/zune/zune4_shots.asp
By default the frame of a JFrame is native. This can be removed by calling Frame.setUndecorated. The Sun Window PL&F does not provide a title bar. You could hack aJInternalFrame so that it draws the frame, although that probably isn't going to be as easy as it may seem. Of course, if you are going the full custom route, you can draw whatever you want. From 6u10, Sun's JRE also provides APIs to make windows transparent and non-rectangular.
No part of a Swing component's look and feel is "native" in any way. Swing components are "lightweight", which means they are entirely drawn on the Java side, and not at all on the windowing system side.
To create custom "chrome" you create the UI delegates for one or more components. In yor case, you'd want to muck around with the delegates for JRootPane and JInternalFrame.
The Look and Feel of Swing apps are pluggable..that is it can change on the fly. You can create your own look and feel but its not a simple undertaking. To get started this tutorial explains. This article does a little more.
This project demonstrates what could be done. So its up to your imagination.

Categories

Resources