java中怎么使容器中的组件排列方式是从上下排列呢?高手指点.. 我有三个按钮,让这三个按钮靠左,上下排列,不是在一行,怎么处理呢?类似于这样的:【】【】【】高手指点啊... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 BoxLayout JFrame jframe = new JFrame("test"); jframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); jframe.setLayout(new BoxLayout(jframe.getContentPane(), BoxLayout.Y_AXIS)); jframe.getContentPane().add(new JLabel("1")); jframe.getContentPane().add(new JLabel("2")); jframe.getContentPane().add(new JLabel("3")); jframe.pack(); jframe.setVisible(true); 使用 Box box = Box.createVerticalBox();box.add(new JLabel("1"));box.add(new JLabel("2"));box.add(new JLabel("3"));container.add(box); 各位帮我解决一下这段代码 急急急!Swing的问题 窗体连接问题! JAVA程序员高级群 如何打印Graphics2D 类的对象? 请教关于数组的一个小问题 如何取出这个obj里面的数据啊 如何判断! rar文件用什么打开,各位! 谁有<<JAVA 2 核心技术 卷1:基础知识>>英文电子版,谢谢[email protected] / [email protected] 想让CheckBox在被选中和取消选中时候,产生不同的动作,应该怎么写?? java如何获取文件属性中的摘要信息
JFrame jframe = new JFrame("test");
jframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
jframe.setLayout(new BoxLayout(jframe.getContentPane(), BoxLayout.Y_AXIS));
jframe.getContentPane().add(new JLabel("1"));
jframe.getContentPane().add(new JLabel("2"));
jframe.getContentPane().add(new JLabel("3"));
jframe.pack();
jframe.setVisible(true);
box.add(new JLabel("1"));
box.add(new JLabel("2"));
box.add(new JLabel("3"));
container.add(box);