swing - How do I add a file browser inside my Java application? -
Display and remove / P>
I have added the files using JFileChooser and know how to delete files. However I got stuck with the display part.
I want to display files and folders in my application using different icons. I tried to add a jiffycloser inside the display panel and disable the dialog box buttons and menu components, but I did not succeed. Is there a better way of doing this?
I like the following methods.
Jfile Chooser Chooser = New Jfile Closer (); Int option = select.showOpenDialog (); If (liked! = JFileChooser.APPROVE_OPTION) return; Selected filefile = selector.taseet selected file (); // You can then file what you want Calling this code will cause a JFileChooser to popup in its own window .
I usually call it JButton 's ActionListener .
fileChooseButton.addActionListener (New Executionist) {Public Zero Action implemented (ActionEvent E) {// file selector code goes here usually}});
Comments
Post a Comment