请教各位,用什么布局管理器能够满足我的想法? 在右边放一个JPanel,再控制JPanel的Layout 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import javax.swing.*;import java.awt.*;public class Frame1 extends JFrame { BorderLayout borderLayout1 = new BorderLayout(); JPanel jPanel1 = new JPanel(); JPanel jPanel2 = new JPanel(); JTextArea jTextArea1 = new JTextArea(); BorderLayout borderLayout2 = new BorderLayout(); FlowLayout flowLayout1 = new FlowLayout(); JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); public Frame1() { try { jbInit(); } catch(Exception ex) { ex.printStackTrace(); } } void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout1); jTextArea1.setText("jTextArea1"); jPanel1.setLayout(borderLayout2); jPanel2.setLayout(flowLayout1); jButton1.setText("jButton1"); jButton2.setText("jButton2"); this.getContentPane().add(jPanel1, BorderLayout.CENTER); jPanel1.add(jTextArea1, BorderLayout.CENTER); this.getContentPane().add(jPanel2, BorderLayout.EAST); jPanel2.add(jButton2, null); jPanel2.add(jButton1, null); }} 多用几个JPANEL嵌套起来就可以实现了 String类 今天在<CORE JAVA>上看到一个抽奖的小算法,与大家分享 学习java需不需要英语 静态的方法与属性不可以被继承对吗? Java 小问题,等代求教 乱码问题! 怎样编写java程序生成类图和序列图?高手救命!! 一个基础的抽象类的疑问,盼解答..在线! JAVA编程一般用什么工具?? 100分!·!高手请进--Applet怎么能在IE中显示调用的Access数据库? drap&drop的问题 为何插入数据有误??
import java.awt.*;public class Frame1 extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
JTextArea jTextArea1 = new JTextArea();
BorderLayout borderLayout2 = new BorderLayout();
FlowLayout flowLayout1 = new FlowLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton(); public Frame1() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
} void jbInit() throws Exception {
this.getContentPane().setLayout(borderLayout1);
jTextArea1.setText("jTextArea1");
jPanel1.setLayout(borderLayout2);
jPanel2.setLayout(flowLayout1);
jButton1.setText("jButton1");
jButton2.setText("jButton2");
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jTextArea1, BorderLayout.CENTER);
this.getContentPane().add(jPanel2, BorderLayout.EAST);
jPanel2.add(jButton2, null);
jPanel2.add(jButton1, null);
}
}