public static void main(String[] args) {
System.setProperty("swing.plaf.metal.controlFont","宋体");
// BGTheme.apply();
JFrame f = new JFrame("背景图片演示");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public class T extends JFrame
{
public T()
{
super("统一设置背景色");
JButton btn = new JButton("测试一");
JPanel p = new JPanel();
p.add(btn);
p.add(new JButton("测试二"));
p.setSize(20,30);
getContentPane().add(p,BorderLayout.SOUTH);
setSize(450,400);
setVisible(true);
}
public static void main(String[] args) throws Exception
{
T app = new T();
setBkColor(app.getContentPane(),Color.YELLOW);
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}