diff -r 45ff83ee1ee9 -r 851c672880a6 jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java --- a/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java Thu Aug 20 13:46:16 2015 +0300 +++ b/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java Thu Aug 20 13:00:19 2015 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -2304,8 +2304,10 @@ } public Rectangle getBounds() { - return parent.getUI().getTabBounds(parent, - parent.indexOfTab(title)); + int i = parent.indexOfTab(title); + // Check for no title. Even though that's a bug in the app we should + // inhibit an ArrayIndexOutOfBoundsException from getTabBounds. + return (i == -1) ? null : parent.getUI().getTabBounds(parent, i); } public void setBounds(Rectangle r) {