aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java')
-rw-r--r--libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java b/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java
index 0d9b625..a9bbe9a 100644
--- a/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java
+++ b/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java
@@ -1,5 +1,5 @@
/* DefaultTableCellRenderer.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,6 @@ import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-import javax.swing.JTextField;
/**
* Class to display every cells.
@@ -59,7 +58,7 @@ public class DefaultTableCellRenderer extends JLabel
{
static final long serialVersionUID = 7878911414715528324L;
- protected static Border noFocusBorder = new EmptyBorder(0, 0, 0, 0);
+ protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
public static class UIResource extends DefaultTableCellRenderer
implements javax.swing.plaf.UIResource
@@ -164,17 +163,17 @@ public class DefaultTableCellRenderer extends JLabel
super.setForeground(table.getForeground());
}
+ Border b = null;
if (hasFocus)
{
- setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
- if (table.isCellEditable(row, column))
- {
- super.setBackground(UIManager.getColor("Table.focusCellBackground"));
- super.setForeground(UIManager.getColor("Table.focusCellForeground"));
- }
+ if (isSelected)
+ b = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
+ if (b == null)
+ b = UIManager.getBorder("Table.focusCellHighlightBorder");
}
else
- setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
+ b = noFocusBorder;
+ setBorder(b);
setFont(table.getFont());