JAL-3054 small y-overlap of tooltip and cell leads the eye better
[jalview.git] / src / jalview / gui / FeatureSettings.java
index c0097cd..062eda1 100644 (file)
@@ -94,6 +94,7 @@ import javax.swing.JSlider;
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
 import javax.swing.SwingConstants;
+import javax.swing.ToolTipManager;
 import javax.swing.border.Border;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
@@ -236,7 +237,7 @@ public class FeatureSettings extends JPanel
       }
 
       /**
-       * Position the tooltip at the bottom edge of, and half way across, the
+       * Position the tooltip near the bottom edge of, and half way across, the
        * current cell
        */
       @Override
@@ -246,12 +247,13 @@ public class FeatureSettings extends JPanel
         int column = table.columnAtPoint(point);
         int row = table.rowAtPoint(point);
         Rectangle r = getCellRect(row, column, false);
-        Point loc = new Point(r.x + r.width / 2, r.y + r.height);
+        Point loc = new Point(r.x + r.width / 2, r.y + r.height - 3);
         return loc;
       }
     };
     table.getTableHeader().setFont(new Font("Verdana", Font.PLAIN, 12));
     table.setFont(new Font("Verdana", Font.PLAIN, 12));
+    ToolTipManager.sharedInstance().registerComponent(table);
 
     // table.setDefaultRenderer(Color.class, new ColorRenderer());
     // table.setDefaultEditor(Color.class, new ColorEditor(this));