Java Directory Dialog not terminating -
i writing java backup manager practice have never programmed in java. code have works, , when effort edit source/destination directory dialog opens never terminated. close, console indicated programme still active. i've tried couple things i've googled no avail. simple, stated before i've never programmed in java until now. help appreciated.
here code have dialog window.
public void dialogwindow( boolean getsource ) { display display = display.getdefault(); ixidialogshell = new shell(display); directorydialog dialog = new directorydialog(ixidialogshell); dialog.setfilterpath( ixiengine.workingdir ); if ( dialog.open() != null ) { if ( getsource ) { sourcetext.settext(dialog.open()); } else { destinationtext.settext(dialog.open()); } } while (!ixidialogshell.isdisposed()) { if ( !display.readanddispatch() ) display.sleep(); } display.dispose(); }
i solved issue. not exiting while loop. changed code code below, , fixed issue without changing behavior of program.
public void dialogwindow( boolean getsource ) { display display = display.getdefault(); ixidialogshell = new shell(display, swt.on_top | swt.system_modal); directorydialog dialog = new directorydialog(ixidialogshell); dialog.setfilterpath( ixiengine.workingdir ); dialog.settext(" directory selection "); string temp = dialog.open(); if ( temp != null ) { if ( getsource ) { sourcetext.settext(temp); } else { destinationtext.settext(temp); } } } if there think should alter here, please allow me know.
java
No comments:
Post a Comment