This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Display message on screen while the process is going on in backend  RSS feed

 
kc pradeep
Greenhorn
Posts: 29
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I have a program where a file is read and corresponding output file is generated. I use JFileChooser to read the file and then display a message at the end of processing with JOptionPane.

The problem there is a long delay between the input action and the output. I want to show a screen wherein I can write "Please wait" or some message..

Can you please let me know how to do this? or if there are any better way to do the same.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the start of the processing you could open a small frame that says "Processing..." and when you finished processing the file just close the frame.
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a SwingWorker. Show a modal (undecorated) JDialog. This dialog cannot be closed since it has no borders. The SwingWorker will then dispose() the dialog in its done() method. In short:
Just do what you want in the JDialog. Perhaps you can do some nifty stuff like show a JProgressBar with setIndeterminate(true) called on it; this will show a bar that keeps moving from left to right to left.

A very simple dialog implementation:

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!