• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the best way to implement this?

 
Zee Ho
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The scenario is that there's two Frame A and B, A should be start first, in it, user can do some configuration (likely to configure the path of the log file), after it is done, the Frame B will show to user.(which is tne main UI of the application).

Currently, I start Frame B when user click the OK button of Frame A (hide the A itself and show the Frame B), but it make the code looks so ugly and hard to read, what I want to do is to centralize all this code to a single file like StartUp class.

But how to make the Frame B "wait" for Frame A to finish its configuraion? I try to use the SwingUtilities.invokeAndWait but it seems only can make the Frame A display first, after it fully display the Frame B will aslo show out.
 
Zee Ho
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And do u guys use java logging as the way to handle the exception? and how do u implement such UI in your application?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Zee,

Why are you not waiting for some event from frame A before creating frame B? For example, creating frame B when the user clicks a "connect" button?

Logging is a very good idea, especially for exception handling. I would not bother with creating a user interface for logging - just log to the command prompt, and turn all logging off before submission.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic