就下面那堆代码哪位大神帮我解释下,我不是很了解 JScrollPane 这个东西private JPanel friendlistPanel;private JScrollPane jsp1;public FriendInterface() {friendlistPanel = new JPanel();jsp1 =new JScrollPane(friendlistPanel);this.f

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 11:21:27
就下面那堆代码哪位大神帮我解释下,我不是很了解 JScrollPane 这个东西private JPanel friendlistPanel;private JScrollPane jsp1;public FriendInterface() {friendlistPanel = new JPanel();jsp1 =new JScrollPane(friendlistPanel);this.f

就下面那堆代码哪位大神帮我解释下,我不是很了解 JScrollPane 这个东西private JPanel friendlistPanel;private JScrollPane jsp1;public FriendInterface() {friendlistPanel = new JPanel();jsp1 =new JScrollPane(friendlistPanel);this.f
就下面那堆代码哪位大神帮我解释下,我不是很了解 JScrollPane 这个东西
private JPanel friendlistPanel;
private JScrollPane jsp1;
public FriendInterface() {
friendlistPanel = new JPanel();
jsp1 =new JScrollPane(friendlistPanel);
this.friendlistPanel.setLayout(new GridLayout(20,1));
}

就下面那堆代码哪位大神帮我解释下,我不是很了解 JScrollPane 这个东西private JPanel friendlistPanel;private JScrollPane jsp1;public FriendInterface() {friendlistPanel = new JPanel();jsp1 =new JScrollPane(friendlistPanel);this.f
public GridLayout(int rows,int cols,int hgap,int vgap)
rows - 行数,0 表示每列可有任意行.
cols - 列数,0 表示每行可有任意列.
hgap - 水平间距.
vgap - 垂直间距.
private JPanel friendlistPanel; //声明对象
private JScrollPane jsp1; //声明对象
setLayout()就是排列方式
这两个对象在构造方法里面实例化!
就这么简单