import java.awt.Color;
import javax.swing.*;class Frame extends JFrame {public Frame(){
this.setBackground(Color.red);
this.setLayout(null);
this.setSize(300,300);
this.setVisible(true);
}
   public static void main(String[] args){
    new Frame();
}
}

解决方案 »

  1.   

    结个贴,给个分...import java.awt.*; 
    import javax.swing.*; public class Replace extends JFrame {  public Replace(){ 
    super("Change Color");

    getContentPane().setBackground(Color.red); setSize(300,300); 
    setVisible(true); 

       public static void main(String[] args){ 
    new Replace(); 

    }
      

  2.   

    能用Frame做自己的类名?