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).
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.
JButton(String text) This constructor will create a button in the component with the specified text in the parameters.
In Swing, classes that represent GUI components have names beginning with the letter J. Some examples are JButton, JLabel, and JSlider.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With