JAL-3253 FeatureTypeSettings use of override paint(g) for "x" button
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Tue, 2 Jul 2019 12:35:33 +0000 (14:35 +0200)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Tue, 2 Jul 2019 12:35:33 +0000 (14:35 +0200)
allows same characterists in Mac and Windows for button background and
border

src/jalview/gui/FeatureTypeSettings.java

index 735e514..950dc8c 100644 (file)
@@ -39,6 +39,7 @@ import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
+import java.awt.Graphics;
 import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -63,7 +64,6 @@ import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.JSlider;
 import javax.swing.JTextField;
-import javax.swing.border.EmptyBorder;
 import javax.swing.border.LineBorder;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
@@ -1442,9 +1442,18 @@ public class FeatureTypeSettings extends JalviewDialog
     if (!patternField.isEnabled()
             || (pattern != null && pattern.trim().length() > 0))
     {
-      JButton removeCondition = new JButton("\u2717"); // Dingbats cursive x
-      removeCondition.setBorder(new EmptyBorder(0, 0, 0, 0));
-      removeCondition.setBackground(Color.WHITE);
+      JButton removeCondition = new JButton("\u2717")
+      {
+        @Override
+        public void paint(Graphics g)
+        {
+          g.setColor(Color.black);
+          g.drawString("\u2717", 2, 14);
+        }
+      }; // Dingbats cursive x
+      // removeCondition.setBackground(null);
+      // removeCondition.setBorder(null);
+      removeCondition.setOpaque(true);
       removeCondition.setPreferredSize(new Dimension(23, 17));
       removeCondition
               .setToolTipText(MessageManager.getString("label.delete_row"));