< prev index next >
src/java.desktop/share/classes/javax/swing/JTabbedPane.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 998,1008 ****
// We can't assume the tab indices correspond to the
// container's children array indices, so make sure we
// remove the correct child!
if (component != null) {
! Component components[] = getComponents();
for (int i = components.length; --i >= 0; ) {
if (components[i] == component) {
super.remove(i);
component.setVisible(true);
break;
--- 998,1008 ----
// We can't assume the tab indices correspond to the
// container's children array indices, so make sure we
// remove the correct child!
if (component != null) {
! Component[] components = getComponents();
for (int i = components.length; --i >= 0; ) {
if (components[i] == component) {
super.remove(i);
component.setVisible(true);
break;
*** 1032,1042 ****
if (index != -1) {
removeTabAt(index);
} else {
// Container#remove(comp) invokes Container#remove(int)
// so make sure JTabbedPane#remove(int) isn't called here
! Component children[] = getComponents();
for (int i=0; i < children.length; i++) {
if (component == children[i]) {
super.remove(i);
break;
}
--- 1032,1042 ----
if (index != -1) {
removeTabAt(index);
} else {
// Container#remove(comp) invokes Container#remove(int)
// so make sure JTabbedPane#remove(int) isn't called here
! Component[] children = getComponents();
for (int i=0; i < children.length; i++) {
if (component == children[i]) {
super.remove(i);
break;
}
*** 1546,1556 ****
// REMIND(aim): this is really silly;
// why not if (page.component.getParent() == this) remove(component)
synchronized(getTreeLock()) {
int count = getComponentCount();
! Component children[] = getComponents();
for (int i = 0; i < count; i++) {
if (children[i] == page.component) {
super.remove(i);
}
}
--- 1546,1556 ----
// REMIND(aim): this is really silly;
// why not if (page.component.getParent() == this) remove(component)
synchronized(getTreeLock()) {
int count = getComponentCount();
! Component[] children = getComponents();
for (int i = 0; i < count; i++) {
if (children[i] == page.component) {
super.remove(i);
}
}
< prev index next >