public void jframe(){ Container cc=this.getContentPane(); this.setVisible(true); cc.setBackground(new Color(0, 224, 121)); this.setBounds(100, 100,300, 300); } public static void main(String[] args) { new jframe().setVisible(true); }
}
public jframe(){ Container cc=this.getContentPane(); this.setVisible(true); cc.setBackground(new Color(0, 224, 121)); this.setBounds(100, 100,300, 300); } public static void main(String[] args) { new jframe().setVisible(true); }
}
你这是SWING,还是winform,可能是楼上说的构造函数的问题
Container cc=this.getContentPane(); 把这个去掉试试;
public jframe(){
this.setBounds(100, 100,300, 300);
this.setBackground(new Color(0, 224, 121));
this.setVisible(true);
}
public static void main(String[] args) {
new jframe();
}
}