我在我的项目中使用 JTabbedPane。在此我可以将选项卡位置更改为顶部、底部、左侧、右侧。喜欢,
tabbedPane.setTabPlacement(JTabbedPane.BOTTOM);
tabbedPane.setTabPlacement(JTabbedPane.TOP);
但我想隐藏所有选项卡,并像普通面板一样使用选项卡式索引 id,而不是在我的设计中显示该选项卡。有没有办法隐藏java swing中的选项卡位置,例如,
tabbedPane.setTabPlacement(null);
使用这个来隐藏选项卡位置
for (int i = 0; i < tabbedPane.getTabCount(); i++) {
tabbedPane.setTabComponentAt(i, new JLabel());
}