Wie erstelle ich eine Schaltfläche, die beim Klicken das Verzeichnis% appdata% öffnet?

Ich habe eine Schaltfläche erstellt, aber ich kann jetzt nicht festlegen, wie ein bestimmtes Verzeichnis geöffnet werden soll%appdata% wenn die Schaltfläche angeklickt wird.

Hier ist der 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.
                }


            }

Und ich möchte so etwas machen ->

private void button4MouseClicked(MouseEvent e) throws IOException {

           open folder %appdata% 
           // Open the folder in the file explorer not in Java.
           // When I click on the button, the folder is viewed with the file explorer on the screen
        }

Antworten auf die Frage(3)

Ihre Antwort auf die Frage