Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在单个选项卡中添加多个组件(例如 a Label、 aTextfield和 a Button)?
Label
Textfield
Button
我尝试使用多个组件创建一个新表单,然后将该表单作为新选项卡添加到 TabbedPane 中,但它引发了异常:java/lang/IllegalArgumentException: A form cannot be added to a container.
java/lang/IllegalArgumentException: A form cannot be added to a container.
任何帮助/想法/提示/链接将不胜感激。
TabbedPane 与用于显示不同选项卡的不同组件一起使用。
new TabbedPane().addTab(title, component)
每个选项卡都需要一个单独的容器,而不是表单!