6800801: NPE in JConsole when using Nimbus L&F
Reviewed-by: alanb, sjiang
This commit is contained in:
parent
99f960f2ef
commit
1d3c8aa708
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -268,8 +268,13 @@ public class ConnectDialog extends InternalDialog
|
|||||||
|
|
||||||
public void revalidate() {
|
public void revalidate() {
|
||||||
// Adjust some colors
|
// Adjust some colors
|
||||||
|
Color disabledForeground = UIManager.getColor("Label.disabledForeground");
|
||||||
|
if (disabledForeground == null) {
|
||||||
|
// fall back for Nimbus that doesn't support 'Label.disabledForeground'
|
||||||
|
disabledForeground = UIManager.getColor("Label.disabledText");
|
||||||
|
}
|
||||||
hintTextColor =
|
hintTextColor =
|
||||||
ensureContrast(UIManager.getColor("Label.disabledForeground"),
|
ensureContrast(disabledForeground,
|
||||||
UIManager.getColor("Panel.background"));
|
UIManager.getColor("Panel.background"));
|
||||||
disabledTableCellColor =
|
disabledTableCellColor =
|
||||||
ensureContrast(new Color(0x808080),
|
ensureContrast(new Color(0x808080),
|
||||||
|
@ -153,9 +153,11 @@ public class VMPanel extends JTabbedPane implements PropertyChangeListener {
|
|||||||
// in order to reserve space for the connect toggle.
|
// in order to reserve space for the connect toggle.
|
||||||
public void setUI(TabbedPaneUI ui) {
|
public void setUI(TabbedPaneUI ui) {
|
||||||
Insets insets = (Insets) UIManager.getLookAndFeelDefaults().get("TabbedPane.tabAreaInsets");
|
Insets insets = (Insets) UIManager.getLookAndFeelDefaults().get("TabbedPane.tabAreaInsets");
|
||||||
insets = (Insets) insets.clone();
|
if (insets != null) {
|
||||||
insets.right += connectedIcon24.getIconWidth() + 8;
|
insets = (Insets) insets.clone();
|
||||||
UIManager.put("TabbedPane.tabAreaInsets", insets);
|
insets.right += connectedIcon24.getIconWidth() + 8;
|
||||||
|
UIManager.put("TabbedPane.tabAreaInsets", insets);
|
||||||
|
}
|
||||||
super.setUI(ui);
|
super.setUI(ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user