怎么将BorderLayout的一个面板里的两个按钮设置间距,就是下面的面板jp里的两个按钮
this.setLayout(newBorderLayout());jp=newJPanel();jp1=newJPanel();jp2=newJPanel();jfc=...
this.setLayout(new BorderLayout());
jp=new JPanel();
jp1=new JPanel();
jp2=new JPanel();
jfc=new JFileChooser();
jtf=new JTextField("请选择待共享的文件");
jb0=new JButton("浏览");
jb1=new JButton("发送");
jp1.setLayout(new GridLayout(1,1));
jp1.add(jtf);
jp.setLayout(new GridLayout(2,1));
jp.add(jb0);
jp.add(jb1);
jp2.setLayout(new GridLayout(1,1));
jp2.add(jpb);
this.add(jp1,"North");
this.add(jp,"Center");
this.add(jp2,"South"); 展开
jp=new JPanel();
jp1=new JPanel();
jp2=new JPanel();
jfc=new JFileChooser();
jtf=new JTextField("请选择待共享的文件");
jb0=new JButton("浏览");
jb1=new JButton("发送");
jp1.setLayout(new GridLayout(1,1));
jp1.add(jtf);
jp.setLayout(new GridLayout(2,1));
jp.add(jb0);
jp.add(jb1);
jp2.setLayout(new GridLayout(1,1));
jp2.add(jpb);
this.add(jp1,"North");
this.add(jp,"Center");
this.add(jp2,"South"); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询