Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm tired of JButtons, how can I make a nicer GUI in java?

Tags:

So far I've only built "small" graphical applications, using swing and JComponents as I learned at school. Yet I can't bear ugly JButtons anymore. I've tried to play with the different JButton methods, like changing colors, putting icons etc. but I'm still not satisfied. How do you make a nicer GUI in java ?

I'm looking for not-too-heavy alternatives (like, without big frameworks or too complicated libraries).

like image 340
Jules Olléon Avatar asked Apr 11 '10 08:04

Jules Olléon


People also ask

Is swing good for GUI?

It is platform independent unlike AWT and has lightweight components. It becomes easier to build applications since we already have GUI components like button, checkbox etc. This is helpful because we do not have to start from the scratch.

What happens when the constructor JButton string msg is called?

JButton(String text) This constructor will create a button in the component with the specified text in the parameters.

Which classes represent GUI components have names beginning with the letter J?

In Swing, classes that represent GUI components have names beginning with the letter J. Some examples are JButton, JLabel, and JSlider.


1 Answers

Swing supports changing the Look & feel.

This tutorial explains how:

UIManager.setLookAndFeel(lookAndFeelClassName); 

Another way is to start your app with the L&F:

java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel MyApp 

Here is a list of 10 very nice look and feels.

like image 94
Bozho Avatar answered Nov 10 '22 10:11

Bozho