提交 ef046a1b 编写于 作者: S ssadetsky

8078269: JTabbedPane UI Property TabbedPane.tabAreaBackground no longer works

Reviewed-by: serb, alexsch
上级 a3c553ae
...@@ -806,11 +806,12 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI { ...@@ -806,11 +806,12 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI {
// Paint the background for the tab area // Paint the background for the tab area
if ( tabPane.isOpaque() ) { if ( tabPane.isOpaque() ) {
if (!c.isBackgroundSet() && (tabAreaBackground != null)) { Color background = c.getBackground();
if (background instanceof UIResource && tabAreaBackground != null) {
g.setColor(tabAreaBackground); g.setColor(tabAreaBackground);
} }
else { else {
g.setColor( c.getBackground() ); g.setColor(background);
} }
switch ( tabPlacement ) { switch ( tabPlacement ) {
case LEFT: case LEFT:
......
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
* questions. * questions.
*/ */
import java.awt.Color; import java.awt.*;
import java.awt.Point;
import java.awt.Robot;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import javax.swing.JFrame; import javax.swing.JFrame;
...@@ -119,6 +117,20 @@ public class Test8007563 implements Runnable { ...@@ -119,6 +117,20 @@ public class Test8007563 implements Runnable {
} }
} }
invokeLater(this); SecondaryLoop secondaryLoop =
Toolkit.getDefaultToolkit().getSystemEventQueue()
.createSecondaryLoop();
new Thread() {
@Override
public void run() {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
}
secondaryLoop.exit();
invokeLater(Test8007563.this);
}
}.start();
secondaryLoop.enter();
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册