1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
private boolean doIt() {
if (this.file==null) this.file = new File(System.getProperty("user.dir")) ;
if (this.scenario == null) {
this.file = selectFile() ;
if (this.file==null) return false ;
final String text = readFile(this.file) ;
if (text == null) return true ;
try { SwingUtilities. invokeLater(new Runnable(){
public void run(){
James.this.scenario = new Scenario(James.this, James.this.file, text) ;
}
}) ; }
catch (Exception e) { e.printStackTrace(); }
}
try {Thread.sleep(1000);} catch (InterruptedException e) {}
return true ;
}
/*
main
*/
public static void main(String params[]) {
James james = new James() ;
while (james.doIt()) ;
} |
Partager