Mega Code Archive

 
Categories / Java Tutorial / Swing
 

UIDefaults Class

import java.awt.Color; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.UIManager; public class UIDefaultsButton {   public static void main(String[] args) {     UIManager.put("Button.background", Color.BLACK);     UIManager.put("Button.foreground", Color.RED);     JFrame aWindow = new JFrame("This is a Border Layout");     aWindow.setBounds(30, 30, 300, 300); // Size     aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     JButton bn = new JButton("asdf");     aWindow.add(bn);     aWindow.setVisible(true); // Display the window   } }