我想覆盖 java 的外观和感觉。我只是想以不同的方式显示按钮。
我想要 Windows 外观和感觉的所有功能,但只是按钮不同。我希望你明白我的意思。
Color color = new Color(220, 220, 220, 200);
UIManager.put("OptionPane.background", color);
UIManager.put("Panel.background", color);
UIManager.put("Button.foreground", new Color(255, 255, 255, 255));
List<Object> gradients = new ArrayList<Object>(5);
gradients.add(0.00f);
gradients.add(0.00f);
gradients.add(new Color(0xC1C1C1));
gradients.add(new Color(0xFFFFFF));
gradients.add(new Color(0x5C5D5C));
UIManager.put("Button.gradient", gradients);
UIManager.put("Button.highlight",Color.RED);
UIManager.setLookAndFeel(com.sun.java.swing.plaf.windows.WindowsLookAndFeel);
也告诉我
如何将 JtabbedPane 做成圆形???
好吧,如果您在应用 Windows LnF 之前更新了 LnF 信息,您就没有机会考虑它们:-)
我建议您通过首先加载 Windows LnF 来反转代码,然后仅更新按钮外观。
但请注意,这样做会改变所有按钮的外观,而不仅仅是您自己的按钮。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)