Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextField not repainting itself when asked  RSS feed

 
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: 21044
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also call revalidate().
 
Campbell Ritchie
Sheriff
Posts: 55292
156
  • 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!