请问在布局管理器里如何使用其他布局管理器如:使用FlowLayout设置一三行的窗口布局
Container contentPane = f.getContentPane();
FlowLayout lay = new FlowLayout(0,0,1);
contentPane.setLayout(lay); JPanel top = new JPanel();
top.setBackground(Color.WHITE);
top.setPreferredSize(new Dimension(350,60));
contentPane.add(top);
JPanel center = new JPanel();
center.setBackground(Color.lightGray);
center.setPreferredSize(new Dimension(350,130));
contentPane.add(center);
JPanel bottom = new JPanel();
bottom.setBackground(Color.GRAY);
bottom.setPreferredSize(new Dimension(350,70));现在要在中间 center中加其他布局,请问用什么方法加啊
Container contentPane = f.getContentPane();
FlowLayout lay = new FlowLayout(0,0,1);
contentPane.setLayout(lay); JPanel top = new JPanel();
top.setBackground(Color.WHITE);
top.setPreferredSize(new Dimension(350,60));
contentPane.add(top);
JPanel center = new JPanel();
center.setBackground(Color.lightGray);
center.setPreferredSize(new Dimension(350,130));
contentPane.add(center);
JPanel bottom = new JPanel();
bottom.setBackground(Color.GRAY);
bottom.setPreferredSize(new Dimension(350,70));现在要在中间 center中加其他布局,请问用什么方法加啊
解决方案 »
- Java String问题!请高手指点!
- 请问个关于打印的问题....我要打印个JFrame遇到了问题
- 正则表达式怎样替换内容。谢了,救命啊!!!!!!!!!!!
- THINK IN JAVA里面的一个例题看不懂 90分答谢解答者
- ★★★★★★★★如何用java实现可视化编程工具?★★★★★★★★
- 师妹向各位师G求教一个菜鸟级问题
- ServletRequest问题?在线(to :cbhyk() 、zhousm6([email protected]))
- 利用SMB读取远程文件错误:ava.io.IOException: Failed to establish session with CALL<00>/xxxx
- 一个特简单的问题,急,等待
- 一个小问题想问问各位高手!!
- Single模式请教
- 小问题半天结帖
center.add()就可以添加其他控件了,想怎么布局都行