Hello Aaron!
JAF> Anton did an excellent job in answering your question #3.
Thanks :)
JAF> I just wanted to add some other points:
Yep, I love to work in team ;-)
I would like to say that I was plainly striken with
your example :-)
However something still scratches my heart when I think about
it more closely..
For one, Startable interface has two methods start() and stop().
But where is our stop() in this example?
Next, as I understand Startable interface it is not the right use of
its contract to do lengthy usefull job in start(). I beleive the
right way would be to create a new thread from start() and signal
it to shutdown in stop().
And last if we're indeed implementing a Swing application, we
shouldn't forget what the run() method in the example did
public void run()
{
while( m_frame.isVisible() )
{
try
{
Thread.sleep( 1000 );
}
catch( InterruptedException ie )
{
m_frame.setVisible( false );
}
}
}
it just made the main() method to _wait_ until swing application
finishes in order to do the dispose() stuff only after that
(the main work of a swing application is done on another thread).
Indeed I do not exactly like the idea of polling m_frame
(interesting, does the isVisisble() method do the synchroniztion?
if yes, its better, but still not perfect, if no..)
The example itself gives a hint of a better implementation, and
that would actually be better IMO.
WBR, Anton
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]