package com.seaglasslookandfeel.demo;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

/**
 * Test text fields.
 */
public class TestTextField {

    /**
     * Main method.
     *
     * @param args DOCUMENT ME!
     */
    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
        } catch (Exception e) {
            e.printStackTrace();
        }

        SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JPopupMenu popupMenu = new JPopupMenu();

                    popupMenu.add("First item");
                    popupMenu.add("Second item");
                    popupMenu.add("Third item");

                    JTextField          tf1 = new JTextField("Here is some text");
                    JTextField          tf2 = new JTextField("Here is some more text");
                    JFormattedTextField tf3 = new JFormattedTextField("Here is some formatted text");
                    JPasswordField      tf4 = new JPasswordField("foo");

                    tf1.setPreferredSize(new Dimension(180, 25));
                    tf2.setPreferredSize(new Dimension(180, 25));
                    tf3.setPreferredSize(new Dimension(180, 25));
                    tf4.setPreferredSize(new Dimension(180, 25));

                    tf1.putClientProperty("JTextField.variant", "search");
                    tf1.putClientProperty("JTextField.Search.PlaceholderText", "Search");
                    tf1.putClientProperty("JTextField.Search.FindPopup", popupMenu);

                    tf1.putClientProperty("JTextField.Search.CancelAction", new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("cancel source = " + e.getSource().getClass().getName());
                            }
                        });

                    tf1.putClientProperty("JTextField.Search.FindAction", new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("find source = " + e.getSource().getClass().getName());
                            }
                        });

                    System.out.println("bg1 = " + tf1.getBackground());
                    System.out.println("bg2 = " + tf2.getBackground());
                    System.out.println("bg3 = " + tf3.getBackground());
                    System.out.println("bg4 = " + tf4.getBackground());

                    JPanel panel = new JPanel();

                    panel.add(tf1);
                    panel.add(tf2);
                    panel.add(tf3);
                    panel.add(tf4);

                    JFrame frame = new JFrame("Title");

                    frame.add(panel, BorderLayout.CENTER);
                    frame.setSize(275, 150);
                    frame.setLocationRelativeTo(null);
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.setVisible(true);
                }
            });
    }
}

@@ -1927,24 +1927,35 @@
 xt%22, %22Search
+ right here
 %22);%0A        
@@ -2712,297 +2712,8 @@
 );%0A%0A
-                    System.out.println(%22bg1 = %22 + tf1.getBackground());%0A                    System.out.println(%22bg2 = %22 + tf2.getBackground());%0A                    System.out.println(%22bg3 = %22 + tf3.getBackground());%0A                    System.out.println(%22bg4 = %22 + tf4.getBackground());%0A%0A
     

Remove debug statement. Add longer placeholder text.