I have made a Java tray Icon. When the user clicks the icon, a pop up appears. I want to add a text field on the pop up. I have tried some code, it does not work for some reason.

public void actionPerformed(ActionEvent e)
{
    System.out.println("In here");
    trayIcon.displayMessage("Pop Up Dictionary", "Please enter a word", TrayIcon.MessageType.INFO);

    JTextField textField = new JTextField();
    textField.setText("This is a text");
    textField.setColumns(20);
}

1 Answers

0
Community On