提交 e5159366 编写于 作者: R rupashka

7200491: Tighten up JTable layout code

Reviewed-by: art, skoivu
上级 c5b96885
...@@ -781,15 +781,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable ...@@ -781,15 +781,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER); scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER);
if (corner == null || corner instanceof UIResource){ if (corner == null || corner instanceof UIResource){
corner = null; corner = null;
Object componentClass = UIManager.get( try {
"Table.scrollPaneCornerComponent"); corner = (Component) UIManager.get(
if (componentClass instanceof Class){ "Table.scrollPaneCornerComponent");
try { } catch (Exception e) {
corner = (Component) // just ignore and don't set corner
((Class)componentClass).newInstance();
} catch (Exception e) {
// just ignore and don't set corner
}
} }
scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER, scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
corner); corner);
......
...@@ -159,7 +159,12 @@ public class NimbusLookAndFeel extends SynthLookAndFeel { ...@@ -159,7 +159,12 @@ public class NimbusLookAndFeel extends SynthLookAndFeel {
// Store Table ScrollPane Corner Component // Store Table ScrollPane Corner Component
uiDefaults.put("Table.scrollPaneCornerComponent", uiDefaults.put("Table.scrollPaneCornerComponent",
TableScrollPaneCorner.class); new UIDefaults.ActiveValue() {
@Override
public Object createValue(UIDefaults table) {
return new TableScrollPaneCorner();
}
});
// Setup the settings for ToolBarSeparator which is custom // Setup the settings for ToolBarSeparator which is custom
// installed for Nimbus // installed for Nimbus
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册