Bigjo
Bigjo

Reputation: 633

Add a JLabel on key press

I have a simple JFrame that implements a KeyListener. I want to add a label when the user type the letter A. When I do so The label doesn't appear directly. When I resize the frame it appear. But it is not the purpose to resize the frame. I want it to appear directly.

How to add a JLabel on key press?

Upvotes: 0

Views: 211

Answers (2)

user2461391
user2461391

Reputation: 1433

Sounds like you need to call the repaint() function to make it appear directly.

Upvotes: 0

Related Questions