From: hansonr Date: Tue, 2 Jul 2019 12:35:33 +0000 (+0200) Subject: JAL-3253 FeatureTypeSettings use of override paint(g) for "x" button X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a207e3ef9cef73d44c9bf99b5e21e224dd307b13;p=jalview.git JAL-3253 FeatureTypeSettings use of override paint(g) for "x" button allows same characterists in Mac and Windows for button background and border --- diff --git a/src/jalview/gui/FeatureTypeSettings.java b/src/jalview/gui/FeatureTypeSettings.java index 735e514..950dc8c 100644 --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@ -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"));