• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextField not repainting itself when asked

 
Kristo Liiva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a setter method which sets the number of columns for the text field and then asks for a repaint, but the text field will not repaint itself. But the text field will repaint itself with the right number of columns when i resize the window. The other method for setting the horizontal alignment works fine. I have no idea what the problem is, can anyone help me?

Here's the code:
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also call revalidate().
 
Campbell Ritchie
Marshal
Posts: 52581
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would sit better in our GUI forum. Moving.
 
Kristo Liiva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works just fine now with the revalidate method, thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!