java - Clear file name when enter directory name and enter -


i'm working on opening file using jfilechooser here code

jfilechooser filechooser = new jfilechooser(); filechooser.setacceptallfilefilterused(false); filenameextensionfilter filter = new filenameextensionfilter("ff files", "ff"); filechooser.addchoosablefilefilter(filter); int result = filechooser.showdialog(null, "pp"); 

on button click event these code running, normal code guess. when click it, jfilechooser dialog appears. if enter directory name in file name field (ex. sam) , hit enter, enters directory, text field still shows entered text i.e 'sam' tried same flow in notepad , in eclipse, in phase, 'sam' getting cleared can provide directory name , hit enter.

correct me if code wrong, if problem duplicate, apology wasted time.

notepad , eclipse use different implementation jfilechooser. that´s why might behave different , don´t think can make work expecting (instead of using custom library or making own implementation).


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -