user1722669
user1722669

Reputation: 508

Stop the thread and make it run on button click;

Good day every one, i have such situation :

SomeDocument doc = DocumentsContainner.getDocument(doc);   
try { 
    DocumentUtitlites.parseDocument(doc);
 } catch (DocumentParseException e) { 
          ManualParsingFrame frame = new ManualParsingFrame(doc);
          frame.show();
 }
NextStageOfUsingDoc(doc); 

ManualParsingFrame is frame where user can see doc text and parsing in manually by selecting text .It's appear as u can see only when parseDocument(SomeDocument doc) throw exception. When user ends manually parsing text he click ok button wich is on frame. And start NextStageOfUsingDoc - some other staff that can be processed only if doc was parse by parseDocument or by user ManualParsingFrame. The question is How to make invoke NextStageOfUsingDoc when user click ok button. Now if i have exception i see frame, but process is continue execution and in result i have visible frame and NextStageOfUsingDoc invoked with non parsed doc object. Thank u for your time.

Upvotes: 1

Views: 119

Answers (1)

Hovercraft Full Of Eels
Hovercraft Full Of Eels

Reputation: 285405

Don't use a JFrame for this. Show your manual parsing info in a modal JDialog. This will stop program flow in the calling program until the modal dialog has been dealt with.

Upvotes: 1

Related Questions