Swing 工具栏放置
我想在分割窗格的右侧显示一个 JToolbar,它也将包含一个 JTabbedPane,我们该怎么做?将 TabbedPane 和工具栏包装在某个组件中? ps:用户不应该能够在右侧窗格中最小化等...
I want to display a JToolbar within right side of a split pane, which is also going to contain a JTabbedPane, how can we do that ? wrap TabbedPane and toolbar in some component? ps: user should not be able to minimize, etc in right side pane...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 JPanel 放在分割窗格的右侧。
给 JPanel 一个 BorderLayout。
将 JToolbar 添加到 JPanel 的北边,将 JTabbedPane 添加到 CENTER。
Put a JPanel on the right side of the split pane.
Give the JPanel a BorderLayout.
Add the JToolbar to the NORTH of the JPanel, and the JTabbedPane to the CENTER.