• Post Reply Bookmark Topic Watch Topic
  • New Topic

Developing a small tool

 
Sivapraveen Chandana
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I am developing a small tool which has a UI built on Swings. Based on the user input, I am doing the processing in a different class. This class has the main method from where I am invoking....

javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
ExcelGeneratorUI.createAndShowGUI();
}
});


After that, I am doing the remaining processing.

The problem is that when I run this class with the main() method ((this class has to process the data entered by the user through the UI)), it is displaying the UI but not waiting until the user enters data and presses "submit" button.

In a nutshell, I want the main() method to proceed further only when the user has clicked on the "submit" button.

Please advise how to do this. Please provide an example.

Thanks in advance....
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you putting that code in the main method instead of an action listener triggered by the submit button?
Spend a little time with the Swing tutorial, in particular the part about action handlers. It will save you a lot of frustration in the long run.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!