I was wondering whether there is a way to take a given .jar file, selected with a JFileChooser, extract it and put it into a new directory. Then, take all the files from another directory, add it to the directory with the extracted .jar file, and then take all that and package it back up again.

I'm doing this because I want a really easy way to install mods for that game, minecraft, where you can just select your minecraft.jar, and make sure the files for the mod are in a folder, and wait a bit, as indicated by a JProgressBar.

This is all I have so far

```
import java.io.*;
import java.util.jar.*;
import javax.swing.*;

public class Main extends JFrame {
    public Main() {
        super("Auto-mod installer");
        setSize(300, 60);
        setLocationRelativeTo(null);
        setResizable(false);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JProgressBar bar = new JProgressBar(0, 100);
        add(bar);
        setVisible(true);
    }

    public static void main(String[] args) {
        Main m = new Main();
    }

    private void extract(File f) {
        //Hrm...
    }

    private void addModFiles() {
        //Uh...
    }

    private void repackage(File f) {
        //What?
    }
}

```

As you can see, I have no idea what I'm doing. I do know what the imports needed are, but that's about it. Help would be appreciated, ranting about anything I did wrong would get me mad. Thanks!

EDIT: If you know a way to get the same results, and it's not the way that I was looking for, please let me know how to do so. As long as I get the results I was looking for, it would be great. Thanks again!