JFrame设置背景色

JFrame设置背景色代码:

import java.awt.Color;
import javax.swing.JFrame;
public class Test {
    public static void main(String[] args) {
        JFrame frame=new JFrame("背景色测试");
        frame.setLocation(150,250);
        frame.setSize(300,200);
        frame.setBackground(Color.blue);
        frame.getContentPane().setVisible(false);
        frame.setVisible(true);
    }
}

 

posted @ 2016-11-20 13:21  大王叫我来加班  阅读(2623)  评论(0编辑  收藏  举报