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:
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?
To edit a Button's properties, double left click or single right click the Button object. The Button Properties dialog will be displayed.
Normally with Java Swing you can set the background color of a button with: myJButton. setBackground(Color. RED);
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
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