swing布局管理器介绍.docVIP

  • 3
  • 0
  • 约1.13万字
  • 约 11页
  • 2019-10-17 发布于湖北
  • 举报
内容面板代码: public static void addComponentsToPane(Container pane) { pane.setLayout(new FlowLayout()); pane.add(new JButton(Button 1)); pane.add(new JButton(Button 2)); pane.add(new JButton(Button 3)); pane.add(new JButton(Long-Named Button 4)); pane.add(new JButton(5)); } BorderLayout 一个BorderLayout对象将界面分成五大区域,分别用BorderLayout类的静态常量指定: _START _END -LINE_START -LINE_END -CENTER 效果: 内容面板代码: public static void addComponentsToPane(Container pane) { JButton button = new JButton(Button 1 (PAGE_START)); pane.add(button, BorderLayout.PAGE_START); button = new JButton(Button 2 (CENTER)); bu

文档评论(0)

1亿VIP精品文档

相关文档