Forums Register Login

Auto Refresh

+Pie Number of slices to send: Send
I have a JTextField.When application starts its text is 20.But depending on the database changes it has to refresh to 10 or 50.How to repaint this JTextField.
+Pie Number of slices to send: Send
Are you talking about the width of the textfield or the text in the textfield? You shouldn't have to repaint the textfield to change the text, just call setText( String text ). If you need to change the width call setColumns( int columns ). Depending on the layout of the container holding the textfield, you may have to call invalidate() or validate() on the container to get it to resize correctly. Also, these methods should be called from the event thread... if you're calling them from another thread they aren't guaranteed to update automatically.
What's that smell? I think this tiny ad may have stepped in something.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1114 times.
Similar Threads
How can I control Eclipse Refresh ?
stats from Paul's site
How do I redirect to "login.jsp" after 5 seconds?
Upload attachment to QC [Quality Center] using java
JARS are visible threrough RAD 7.0
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:29:28.