|
|
@ -29,6 +29,7 @@ import javax.swing.*; |
|
|
|
import javax.swing.plaf.ComponentUI; |
|
|
|
import javax.swing.plaf.ComponentUI; |
|
|
|
import javax.swing.plaf.UIResource; |
|
|
|
import javax.swing.plaf.UIResource; |
|
|
|
import javax.swing.table.DefaultTableCellRenderer; |
|
|
|
import javax.swing.table.DefaultTableCellRenderer; |
|
|
|
|
|
|
|
import javax.swing.table.TableCellRenderer; |
|
|
|
import javax.swing.table.TableColumn; |
|
|
|
import javax.swing.table.TableColumn; |
|
|
|
import javax.swing.table.TableColumnModel; |
|
|
|
import javax.swing.table.TableColumnModel; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
@ -42,7 +43,6 @@ public class DarkTableHeaderUI extends DarkTableHeaderUIBridge { |
|
|
|
protected Color borderColor; |
|
|
|
protected Color borderColor; |
|
|
|
protected Color background; |
|
|
|
protected Color background; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static ComponentUI createUI(final JComponent c) { |
|
|
|
public static ComponentUI createUI(final JComponent c) { |
|
|
|
return new DarkTableHeaderUI(); |
|
|
|
return new DarkTableHeaderUI(); |
|
|
|
} |
|
|
|
} |
|
|
@ -56,7 +56,8 @@ public class DarkTableHeaderUI extends DarkTableHeaderUIBridge { |
|
|
|
headerHeight = HEADER_HEIGHT; |
|
|
|
headerHeight = HEADER_HEIGHT; |
|
|
|
} |
|
|
|
} |
|
|
|
header.setPreferredSize(new Dimension(dim.width, Math.max(dim.height, headerHeight))); |
|
|
|
header.setPreferredSize(new Dimension(dim.width, Math.max(dim.height, headerHeight))); |
|
|
|
if (header.getDefaultRenderer() instanceof DefaultTableCellRenderer) { |
|
|
|
TableCellRenderer defaultRenderer = header.getDefaultRenderer(); |
|
|
|
|
|
|
|
if (defaultRenderer instanceof DefaultTableCellRenderer) { |
|
|
|
DefaultTableCellRenderer renderer = (DefaultTableCellRenderer) header.getDefaultRenderer(); |
|
|
|
DefaultTableCellRenderer renderer = (DefaultTableCellRenderer) header.getDefaultRenderer(); |
|
|
|
renderer.setHorizontalAlignment(SwingConstants.LEADING); |
|
|
|
renderer.setHorizontalAlignment(SwingConstants.LEADING); |
|
|
|
} |
|
|
|
} |
|
|
|