http://www.studyjava.com/download/index.asp到上面下个JB9 全都解决了

解决方案 »

  1.   

    import javax.swing.*;
    import java.awt.*; 
    public class myJFrame extends JFrame {
      JLabel jLabel1 = new JLabel();
      JScrollPane jScrollPane1 = new JScrollPane();  String [] init ={"这是第一项","这是第二项","这是第三项","这是第四项","这是第五项"};
        JList jList1 = new JList(init);
      JPanel jPanel1 = new JPanel();
      public myJFrame() {
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      public static void main(String[] args) {
        myJFrame myJFrame = new myJFrame();
      }
      private void jbInit() throws Exception {
        jLabel1.setVerifyInputWhenFocusTarget(true);
        jLabel1.setText("Hai");
        this.getContentPane().add(jLabel1, BorderLayout.SOUTH);
        this.getContentPane().add(jScrollPane1, BorderLayout.CENTER);
        this.getContentPane().add(jPanel1, BorderLayout.NORTH);
        jScrollPane1.getViewport().add(jList1, null);
      }
    }
    上面有几个控件
      

  2.   

    import java.awt.*;
    import java.awt.event.*;public class Demo extends Frame{
      Button b = new Button("Close");
      public Demo(){
        b.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){dispose();System.exit(0);}});
        add(b);
      }  public static void main(String [] args){
        Demo f = new f();
        f.show();
      }
    }
      

  3.   

    duoshanx(我喜欢春天.小草绿了,水朗润了起来..) 
    你的代码不报错,不提示也不出现窗体。
      

  4.   

    myJFrame.setVisible(true);
    加上这个以后正常现示。