wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Won't repaint! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Won Watch "Won New topic
Author

Won't repaint!

William Kohus
Greenhorn

Joined: Feb 19, 2012
Posts: 11
I have to enter text into my jtextfield and have it show in the lbChoices jlist WHEN the focus is lost. It acts like it is there because I have a no duplicate line in there that appears when I try to type the same thing twice! Driving me crazy! Any help would be greatly appreciated. Thank you.





HERE IS MY FULL CODE


Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 171
    
    5

Do you mean that the text isn't in the JList before you enter the new list item, but you get a no duplicates message and then the text still isn't in the JList?

The JList should repaint when the entry is added, and there should be no need to repaint when the list contents are not modified. Repainting a JList will repaint each element in the list. To ensure the list is repainted (equivalent to repaint() call) is cover up the JList and uncover it. This will force all elements in the list to rerender themselves.


Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
it's likely to be the way you've created the initial model

change
William Kohus
Greenhorn

Joined: Feb 19, 2012
Posts: 11
Michael Dunn wrote:it's likely to be the way you've created the initial model

change



Michael Dunn, you are the man. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Won't repaint!