java - Setting background color to JButton -
2021-3-22 · 2 Answers2. This will work with either the Metal (default) or Windows PLAFs. import java.awt.Color; import javax.swing.*; class ColoredButton { public static void main (String [] args) { Runnable r = () -> { try { UIManager.setLookAndFeel ( UIManager.getSystemLookAndFeelClassName ()); } catch (Exception e) { …
Get Price