I made a button, but now I donβt know how to make it open a specific directory, for example %appdata% , when the button is clicked.
Here is the code β
//---- button4 ---- button4.setText("Texture Packs"); button4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JFileChooser fileChooser=new JFileChooser("%appdata%"); int status = fileChooser.showOpenDialog(this); fileChooser.setMultiSelectionEnabled(false); if(status == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); // do something on the selected file. } }
And I want to do something like this β
private void button4MouseClicked(MouseEvent e) throws IOException { open folder %appdata%
java eclipse directory jframe
Malasuerte94 Jun 10 '12 at 7:20 2012-06-10 07:20
source share