【发布时间】:2013-02-14 03:26:33
【问题描述】:
我对 java swing 非常陌生,java 也是如此。我使用 netbeans 的窗口构建器来设计 GUI。我有一个名为 orderListPanel 的 JPanel,其中包括一个名为 orderListRowPanel 的 JPanel。现在,我得到了一个 JPanel 列表,我想将这些 JPanel 插入 orderListPanel。
http://postimage.org/image/ex00whf69/
orderListPanel 在中间,orderListRowPanel 和 orderListPanel 一样
http://postimage.org/image/dbrtn33sj/
现在我想在 orderListPanel 中插入许多 JPanel 并使它看起来像一个列表。红色方块是 JPanel 中的组件。
我尝试使用 BorderLayout,当我使用 foreach 循环 orderListPanel.add(List pList),我在 orderListPanel 中看不到任何结果。有人知道怎么解决吗?
【问题讨论】:
标签: java swing layout dynamic netbeans