TextField: added "clear" button to theme editor find/replace and to UI defaults inspector

This commit is contained in:
Karl Tauber
2021-12-14 10:42:07 +01:00
parent 02a9d4e31d
commit 45332c8126
4 changed files with 12 additions and 5 deletions

View File

@@ -43,6 +43,7 @@ import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumnModel;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.extras.components.FlatTextField;
import com.formdev.flatlaf.icons.FlatAbstractIcon;
import com.formdev.flatlaf.ui.FlatBorder;
import com.formdev.flatlaf.ui.FlatEmptyBorder;
@@ -557,7 +558,7 @@ public class FlatUIDefaultsInspector
panel = new JPanel();
filterPanel = new JPanel();
flterLabel = new JLabel();
filterField = new JTextField();
filterField = new FlatTextField();
valueTypeLabel = new JLabel();
valueTypeField = new JComboBox<>();
scrollPane = new JScrollPane();
@@ -588,7 +589,8 @@ public class FlatUIDefaultsInspector
new Insets(0, 0, 0, 10), 0, 0));
//---- filterField ----
filterField.putClientProperty("JTextField.placeholderText", "enter one or more filter strings, separated by space characters");
filterField.setPlaceholderText("enter one or more filter strings, separated by space characters");
filterField.setShowClearButton(true);
filterPanel.add(filterField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 10), 0, 0));
@@ -667,7 +669,7 @@ public class FlatUIDefaultsInspector
private JPanel panel;
private JPanel filterPanel;
private JLabel flterLabel;
private JTextField filterField;
private FlatTextField filterField;
private JLabel valueTypeLabel;
private JComboBox<String> valueTypeField;
private JScrollPane scrollPane;

View File

@@ -20,9 +20,10 @@ new FormModel {
"labelFor": new FormReference( "filterField" )
"displayedMnemonic": 70
}, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) )
add( new FormComponent( "javax.swing.JTextField" ) {
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatTextField" ) {
name: "filterField"
"$client.JTextField.placeholderText": "enter one or more filter strings, separated by space characters"
"placeholderText": "enter one or more filter strings, separated by space characters"
"showClearButton": true
}, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) {
"gridx": 1
} )