Tab switcher tab position fix

This commit is contained in:
Jindra Petřík
2024-10-13 19:11:51 +02:00
parent 60b3801a92
commit b341837df4

View File

@@ -61,8 +61,8 @@ public class TabSwitcher<E> extends JPanel {
this.tabComponent = tabComponent;
centralPanel = new JPanel();
centralPanel.setLayout(null);
centralPanel.add(tabbedPane);
centralPanel.add(tabComponent);
centralPanel.add(tabbedPane);
setLayout(new BorderLayout());
add(centralPanel, BorderLayout.CENTER);
addComponentListener(new ComponentAdapter() {
@@ -97,7 +97,8 @@ public class TabSwitcher<E> extends JPanel {
maxH = h;
}
}
tabbedPane.setBounds(0, 0, centralPanel.getWidth(), maxH);
maxH += 2;
tabbedPane.setBounds(0, 0, centralPanel.getWidth(), maxH + 10);
tabComponent.setBounds(0, maxH, centralPanel.getWidth(), centralPanel.getHeight() - maxH);
}