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

lost text  RSS feed

Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

In my project I save objects to file. One such object I call Listbox. It extends JScrollPane and its viewport contains a JList.
It looks like so:

In my SaveFile() method using SwingUtilities.invokeLater() method (see below), I can save all the objects to file alright, but the text in my Listbox keeps disappearing. I have tried calling repaint(), revalidate() on both Listbox and the JList it contains, but neither works. The text is there, it just isn't showing after a save. What am I doing wrong?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!