Change Default Buttons in Java to Make Them Look "Better"
Asked Answered
B

1

9

I'm essentially trying to mimic the default windows xp simple calculator. When I change the background colours of the buttons in Java it makes them look very flat and "boring". I want to make the buttons look as close as possible to the buttons in the Windows XP calculator.

Here is an image comparing mine to WinXp's: calc example

Is there some kind of method I can use to change the style of the buttons much like you can do in Visual Basic to make the buttons almost pop more or look 3D like the Windows Xp Calculator.

The default buttons in Java are sort of what I'm looking for except there not white there more of a blue kind of colour in a gradient.

Is this possible, or am I stuck with ugly button?

Boy answered 24/4, 2012 at 20:1 Comment(1)
see #2592707Duumvir
I
21

Try setting the system look and feel at the beginning of the main method:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

This will load all Swing widgets with a native-ish look.

If you are insterested in what you are actually doing with this command, Oracle has a nice tutorial regarding look and feels: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

Incidence answered 24/4, 2012 at 20:3 Comment(1)
This has the added (huge) advantage that it does not foist the Windows look on users of OS X or *nix, who (generally) prefer the look of their native system.Thermochemistry

© 2022 - 2024 — McMap. All rights reserved.