Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ public List<JTabbedPaneTabInfo> getTabs() {
Component componentObject = pane.getComponentAt(i);
ComponentInfo component = (ComponentInfo) getChildByObject(componentObject);
if (component != null) {
Rectangle bounds = CoordinateUtils.get(pane.getBoundsAt(i));
tabs.add(new JTabbedPaneTabInfo(this, component, bounds));
java.awt.Rectangle awtBounds = pane.getBoundsAt(i);
if (awtBounds != null) {
Rectangle bounds = CoordinateUtils.get(pane.getBoundsAt(i));
tabs.add(new JTabbedPaneTabInfo(this, component, bounds));
}
}
}
//
Expand Down Expand Up @@ -145,19 +148,16 @@ protected void refresh_afterCreate() throws Exception {
{
int tabCount = pane.getTabCount();
for (int i = tabCount - 1; i >= 0; i--) {
if (pane.getComponentAt(i) == null || pane.getBoundsAt(i) == null) {
if (pane.getComponentAt(i) == null) {
pane.remove(i);
}
}
}
// apply active component
{
ComponentInfo activeComponentInfo = getActiveComponent();
if (activeComponentInfo != null) {
Component activeComponent = activeComponentInfo.getComponent();
if (activeComponent != null && pane.indexOfComponent(activeComponent) != -1) {
pane.setSelectedComponent(activeComponent);
}
ComponentInfo activeComponent = getActiveComponent();
if (activeComponent != null) {
pane.setSelectedComponent(activeComponent.getComponent());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

import java.awt.Color;
import java.awt.Component;
import java.util.Collections;
import java.util.List;

import javax.swing.JTabbedPane;
Expand Down Expand Up @@ -210,7 +211,7 @@ public void repaint(Rectangle r) {
JTabbedPaneInfo tabbed = (JTabbedPaneInfo) panel.getChildrenComponents().get(0);
assertNoErrors(panel);
// ask tabs
Assertions.assertThat(tabbed.getTabs()).isEmpty();
assertEquals(tabbed.getTabs(), Collections.emptyList());
}

/**
Expand Down
Loading