search

Home  >  Q&A  >  body text

java图形编程

jfm.setLayout(new FlowLayout());
如果把这个布局换成
jfm.setLayout(new BorderLayout());
为什么在容器上就不能显示添加的组件呢?
是不是还要声明个面板JPanel呢?
将组件添加进容器使用的是
jfm.add(组件名称);

请教一下
想要弄成以下的样子

PHP中文网PHP中文网2809 days ago570

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 13:07:13

    How many components did you add to jfm?

    BorderLayout defaults to layout child components at the BorderLayout.CENTER position of the parent component, so multiple components may be blocked. You can specify where each component is located.

    About Java Layout Manager http://blog.sina.com.cn/s/blog_6f116c940101alna.html

    reply
    0
  • Cancelreply