Change the default button in Java to make it look better

I tried to imitate the default Windows XP simple calculator When I change the background color of buttons in Java, it makes them look flat and "boring" I want the buttons to look as close as possible to the buttons in the Windows XP calculator

This is an image comparing my WinXP:

Is there any way to change the style of buttons, as you can do in visual basic, to make buttons almost more popular, or to look like 3D like Windows XP calculator

The default button in Java is what I'm looking for, except that there is no white gradient with a blue color

Is it possible or am I stuck in an ugly button?

Solution

Try to set the system appearance at the beginning of the main method:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

This will load the native - ish appearance of all swing widgets

If you are interested in actually using this command, Oracle will have a good tutorial: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>