summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-04-30 09:34:21 +0000
committerRoman Kennke <roman@kennke.org>2006-04-30 09:34:21 +0000
commit04e887d1886db641e27e90a0c5c9f56d988a4a2e (patch)
treee6fb5817d40cbfce116dbf1dca0dbfb198d3234a
parent8ba0af0392375c456d89246f8030ba401490c9b0 (diff)
downloadclasspath-04e887d1886db641e27e90a0c5c9f56d988a4a2e.tar.gz
2006-04-30 Roman Kennke <kennke@aicas.com>
* javax/swing/plaf/basic/BasicTabbedPaneUI.java (lastTabInRun): Fix calculation of the last tab in a run. This has caused painting problems sometimes, making the last tab painted incorrectly.
-rw-r--r--ChangeLog7
-rw-r--r--javax/swing/plaf/basic/BasicTabbedPaneUI.java19
2 files changed, 23 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ed820ad1a..f04a5ca24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-30 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java
+ (lastTabInRun): Fix calculation of the last tab in a run. This
+ has caused painting problems sometimes, making the
+ last tab painted incorrectly.
+
2006-04-30 Audrius Meskauskas <AudriusA@Bioinformatics.org>
PR 27297
diff --git a/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index 4b1a93282..6d9bed331 100644
--- a/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -2559,10 +2559,23 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
*/
protected int lastTabInRun(int tabCount, int run)
{
- if (tabRuns[run] == 0)
- return tabCount - 1;
+ int lastTab;
+ if (runCount == 1)
+ lastTab = tabCount - 1;
else
- return tabRuns[run] - 1;
+ {
+ int nextRun;
+ if (run == runCount - 1)
+ nextRun = 0;
+ else
+ nextRun = run + 1;
+
+ if (tabRuns[nextRun] == 0)
+ lastTab = tabCount - 1;
+ else
+ lastTab = tabRuns[nextRun] - 1;
+ }
+ return lastTab;
}
/**