import java.awt.*;
import javax.swing.*;
public class E7_1 extends JFrame
{
private JMenuBar mb=new JMenuBar();
private JMenu mm=new JMenu("File");
private JMenuItem mi1=new JMenuItem("复制");
private JMenuItem mi2=new JMenuItem("粘贴");
private JLabel w=new JLabel();
public class E7_1()
{
this.setLayout(null);
mm.add(mi1);
mm.add(mi2);
mb.add(mm);
this.setJMenuBar(mb);
w.setText("Swing与AWT控件的混用!!!!");
w.setBounds(10,10,450,30);
this.add(w);
this.setBounds(330,250,500,150);
this.setVisible(true);
}
public static void main(String arg[])
{
new E7_1();
}

}
哪里错啊,我找了半天~~~~··

解决方案 »

  1.   


    import java.awt.*; 
    import javax.swing.*; 
    public class E7_1 extends JFrame 

    private JMenuBar mb=new JMenuBar(); 
    private JMenu mm=new JMenu("File"); 
    private JMenuItem mi1=new JMenuItem("复制"); 
    private JMenuItem mi2=new JMenuItem("粘贴"); 
    private JLabel w=new JLabel(); 
    public E7_1() 

    this.setLayout(null); 
    mm.add(mi1); 
    mm.add(mi2); 
    mb.add(mm); 
    this.setJMenuBar(mb); 
    w.setText("Swing与AWT控件的混用!!!!"); 
    w.setBounds(10,10,450,30); 
    this.add(w); 
    this.setBounds(330,250,500,150); 
    this.setVisible(true); 

    public static void main(String arg[]) 

    new E7_1(); 
    } } 
      

  2.   

    public class E7_1()
    {
    this.setLayout(null);
    mm.add(mi1);
    mm.add(mi2); 
      

  3.   

    public class E7_1() //把class去掉

    this.setLayout(null); 
    mm.add(mi1); 
    mm.add(mi2); 
    mb.add(mm); 
      

  4.   

    这里:public class E7_1()