mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-24 09:10:08 +00:00
7200491: Tighten up JTable layout code
Reviewed-by: art, skoivu
This commit is contained in:
parent
d3ccd20d1f
commit
ec9f5edf2f
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user