1. menu item and jfilechooser coderanch.comwhen 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.comSir 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. |