0

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
  • textField is never added to a visible window or component. Commented Oct 6, 2019 at 4:11

1 Answer 1

0

:Check out the documentation:

https://docs.oracle.com/javase/tutorial/uiswing/misc/systemtray.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.