package example;
//-*- mode:java; encoding:utf8n; coding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;

public class MainPanel extends JPanel {
    private final JTextField field1 = new JTextField("Please enter your E-mail address");
    private final JTextField field2 = new JTextField("History Search");
    public MainPanel() {
        super(new BorderLayout());
        field1.addFocusListener(new HintTextFocusListener(field1));
        field2.addFocusListener(new HintTextFocusListener(field2));

        Box box = Box.createVerticalBox();
        box.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        box.add(makePanel("E-mail", field1));
        box.add(Box.createVerticalStrut(5));
        box.add(makePanel("Search", field2));

        add(box, BorderLayout.NORTH);
        setPreferredSize(new Dimension(320, 180));
    }
    private static JPanel makePanel(String title, JComponent c) {
        JPanel p = new JPanel(new BorderLayout());
        p.setBorder(BorderFactory.createTitledBorder(title));
        p.add(c);
        return p;
    }
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try{
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }catch(Exception e) {
            e.printStackTrace();
        }
        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}
class HintTextFocusListener implements FocusListener {
    private static final Color INACTIVE_COLOR = UIManager.getColor("TextField.inactiveForeground");
    private static final Color ORIGINAL_COLOR = UIManager.getColor("TextField.foreground");
    private final String hintMessage;
    public HintTextFocusListener(final JTextComponent tf) {
        hintMessage = tf.getText();
        tf.setForeground(INACTIVE_COLOR);
    }
    @Override public void focusGained(final FocusEvent e) {
        JTextComponent textField = (JTextComponent)e.getSource();
        String str = textField.getText();
        Color col  = textField.getForeground();
        if(hintMessage.equals(str) && INACTIVE_COLOR.equals(col)) {
            textField.setForeground(ORIGINAL_COLOR);
            textField.setText("");
        }
    }
    @Override public void focusLost(final FocusEvent e) {
        JTextComponent textField = (JTextComponent)e.getSource();
        String str = textField.getText().trim();
        if("".equals(str)) {
            textField.setForeground(INACTIVE_COLOR);
            textField.setText(hintMessage);
        }
    }
}

@@ -492,32 +492,35 @@
 istener(new 
-HintText
+Placeholder
 FocusListene
@@ -567,24 +567,27 @@
 ner(new 
-HintText
+Placeholder
 FocusLis
@@ -1860,24 +1860,27 @@
 %7D%0Aclass 
-HintText
+Placeholder
 FocusLis
@@ -1951,22 +1951,16 @@
 INACTIVE
-_COLOR
  = UIMan
@@ -2010,100 +2010,8 @@
 %22);%0A
-    private static final Color ORIGINAL_COLOR = UIManager.getColor(%22TextField.foreground%22);%0A
     
@@ -2059,16 +2059,19 @@
 lic 
-HintText
+Placeholder
 Focu
@@ -2080,22 +2080,16 @@
 istener(
-final 
 JTextCom
@@ -2166,30 +2166,24 @@
 und(INACTIVE
-_COLOR
 );%0A    %7D%0A   
@@ -2217,22 +2217,16 @@
 sGained(
-final 
 FocusEve
@@ -2253,32 +2253,25 @@
 tComponent t
-extField
+f
  = (JTextCom
@@ -2296,98 +2296,8 @@
 ();%0A
-        String str = textField.getText();%0A        Color col  = textField.getForeground();%0A
     
@@ -2322,19 +2322,28 @@
 .equals(
-str
+tf.getText()
 ) && INA
@@ -2351,22 +2351,16 @@
 TIVE
-_COLOR
 .equals(
 col)
@@ -2359,66 +2359,102 @@
 als(
-col)) %7B%0A            textField.setForeground(ORIGINAL_COLOR
+tf.getForeground())) %7B%0A            tf.setForeground(UIManager.getColor(%22TextField.foreground%22)
 );%0A 
@@ -2461,32 +2461,25 @@
            t
-extField
+f
 .setText(%22%22)
@@ -2532,22 +2532,16 @@
 cusLost(
-final 
 FocusEve
@@ -2572,24 +2572,17 @@
 ponent t
-extField
+f
  = (JTex
@@ -2619,73 +2619,40 @@
     
-String str = textField.getText().trim();%0A        if(%22%22.equals(str
+if(%22%22.equals(tf.getText().trim()
 )) %7B
@@ -2661,32 +2661,25 @@
            t
-extField
+f
 .setForegrou
@@ -2693,14 +2693,8 @@
 TIVE
-_COLOR
 );%0A 
@@ -2705,24 +2705,17 @@
        t
-extField
+f
 .setText

rename "HintTextFocusListener" to "PlaceholderFocusListener"