File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Won't repaint!

 
William Kohus
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's likely to be the way you've created the initial model

change
 
William Kohus
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic