• Post Reply Bookmark Topic Watch Topic
  • New Topic

Want to return to main GUI  RSS feed

 
Scott Steffen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
Im writing an app for school project. It's got several .java source files. The main GUI is a Jframe with a simple menu with some submenus that do things. Question. I have an actionListener on a menu item(JMenuItem) Analyze. A JTable will popup showing all analyzed files(dont worry about all the details-- analyzed files are sound files (.wav)(train horn noise) that have been analyzed to show their amplitude values). It gets these from a database. However if there are no files analyzed yet, I want to call an ErrorHandler and inform the user to first analyze a file. My error message pops up, BUT, it continues with some functionality in this Analyze java file -- for example it pops up the JTable showing no rows--I dont want this! I want to stop all execution of this file and return to the main menu GUI. Any suggestions?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which forum would you like the answer posted in?
 
Scott Steffen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry perhaps the Swing one.
Scott
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have a JMenuItem 'analyze', when clicked:
retrieves file info from db (make sure you do this in a separate thread - likely to block the swing thread EDT)
shows JTable with file info

all you need to do is add a simple check

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