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); } }