public class FirstGuiTest extends JFrame implements ActionListener {
private JPanel contentPane;
private JTextField textField;
private JButton btnEnter;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
FirstGuiTest frame = new FirstGuiTest();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public FirstGuiTest() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
textField = new JTextField();
textField.setBounds(329, 38, 39, 23);
contentPane.add(textField);
textField.setColumns(10);
btnEnter = new JButton("ENTER");
btnEnter.setBounds(304, 74, 89, 23);
contentPane.add(btnEnter);
btnEnter.addActionListener(this);
textField.addActionListener(this);
}
public void guessWord(String word) {
String result = word;
result.replaceAll(word, "_");
String[] alphabet = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
"s", "t", "u", "v", "w", "x", "y", "z" };
if (alphabet.equals(word)) {
}
}
public void actionPerformed(ActionEvent e) {
}