其他分享
首页 > 其他分享> > JScrollPane

JScrollPane

作者:互联网

package cn.rushangw.lesson05;

import javax.swing.*;
import java.awt.*;

public class JScrollDemo extends JFrame{

public JScrollDemo() {
Container container = getContentPane();

//文本域
TextArea textArea = new TextArea(50, 50);
textArea.setText("什么是快乐星球?");
JScrollPane scrollPane = new JScrollPane(textArea);
container.add(scrollPane);


setVisible(true);
setBounds(1,1,500,500);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

}

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

标签:textArea,JScrollDemo,JScrollPane,scrollPane,new,public
来源: https://www.cnblogs.com/nigustudent/p/14810158.html