7200491: Tighten up JTable layout code

Reviewed-by: art, skoivu
This commit is contained in:
Pavel Porvatov 2012-11-06 15:30:34 +04:00
parent d3ccd20d1f
commit ec9f5edf2f
2 changed files with 11 additions and 10 deletions

View File

@ -781,15 +781,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER);
if (corner == null || corner instanceof UIResource){
corner = null;
Object componentClass = UIManager.get(
"Table.scrollPaneCornerComponent");
if (componentClass instanceof Class){
try {
corner = (Component)
((Class)componentClass).newInstance();
} catch (Exception e) {
// just ignore and don't set corner
}
try {
corner = (Component) UIManager.get(
"Table.scrollPaneCornerComponent");
} catch (Exception e) {
// just ignore and don't set corner
}
scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
corner);

View File

@ -159,7 +159,12 @@ public class NimbusLookAndFeel extends SynthLookAndFeel {
// Store Table ScrollPane Corner Component
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
// installed for Nimbus