Menu « JFileChooser « Java Swing Q&A





1. menu item and jfilechooser    coderanch.com

when i select the file, i would like to pass it to another class i created public class Test extends JFrame{ /*some variable here....*/ public Test(){ ImgPane imgPane; setContentPane(pane); setDefaultCloseOperation ( EXIT_ON_CLOSE ); openMenuItem.addActionListener( new ActionListener(){ public void actionPerformed(ActionEvent e){ JFileChooser fc = new JFileChooser("."); int choice = fc.showOpenDialog(Testthis); if (choice == JFileChooser.APPROVE_OPTION) { imgPane = new ImgPane(fc.getSelectedFile()); } } }); ...

2. how to get platform popup menu in jfilechooser as FileDialog    forums.oracle.com

Sir i have created my project on jfilechooser and i also wan't jFilechooser to show a platforn(like Windows XP) popup menu as FileDialog shows by right clicking on a file. Is there any code to get popupmenu of FileDialog as it has the system popupmenu(like openwith,view->thumbnail,properties) like windows explorer shows. Can it will be done for JFileChooser. Please help.