JScorllPane面板(带滚轮的JPane)

public class JscrollPaneTest extends JFrame{

    public JscrollPaneTest() {
        // TODO Auto-generated constructor stu
        Container c = getContentPane();
        JTextArea ta = new JTextArea(20,50);
        JScrollPane sp = new JScrollPane(ta);
        c.add(sp);
        setTitle("带滚轮条的文字编译器");
        setSize(200,200);
        setVisible(true);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        new JscrollPaneTest();
    }
}

 

posted @ 2019-03-22 14:08  小小超plus  阅读(648)  评论(0)    收藏  举报