0

I am trying to create a .jar file for my A-Level computing project, and I am so confused as to why it will not work. I have been scouring the forums here, and the internet in general, but I just cannot seem to find a solution I can understand. Posts like this one, seem to be the same problem, but I really do not understand what it means or more importantly how to even start implementing it . I would really appreciate it if you guys could help me, as I thought I was doing it right but obviously not. What I would like is just a simple way to export a Java executable so that teachers and other students can run it without the necessity of any sort of IDE, so it is easy for them to run the file. I have tried pressing clean and build, but that is not working, when I run the program in the dist folder it just does nothing, and I do not feel that will make it easy to send to other users who do not use netbeans (or java at all).

My Class that contains the main code is as follows, I know it is really long, but I would rather give you more to work with than less (fyi it works in the JDK).

Sorry this is probably a really stupid question with an obvious answer, but I am out of options, thanks alot for any help.

Update - Right clicking the project folder and pressing test, has the same effect as running the jar file from the dist folder, it does not work, nothing pops up on the screen.

Further Update - Running the program from the command line yielded this error message: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.ImageIcon.(Unknown Source) at Prototype1.GUI.GraphicalUserInterface.topBar(GraphicalUserInterface.java:93) at Prototype1.GUI.GraphicalUserInterface.addComponentToPane(GraphicalUserInterface.java:40) at Prototype1.GUI.GraphicalUserInterface.createAndShowGUI(GraphicalUserInterface.java:382) at Prototype1.GUI.GraphicalUserInterface.access$000(GraphicalUserInterface.java:17) at Prototype1.GUI.GraphicalUserInterface$1.run(GraphicalUserInterface.java:409) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

Thanks,

-Velinguard

public class GraphicalUserInterface implements ActionListener {
    final static String SOFTWARENAME = "Star Explorer";
    final static String LOGINPANEL = "Login Screen";
    final static String ADDUSERPANEL = "Add User";
    final static String HOMESCREENPANEL = "Home";
    final static String ADDELEMENTPANEL = "Add Element";
    final static String HOWITWORKSPANEL = "How It Works";
    final static String CREDITSPANEL = "Credits";
    JLabel label, label2;
    int index, state;
    String username;
    JButton loginButton, homeButton, starButton, elementButton, userButton, creditsButton, addUserButton, searchForEmission, matchStar, addElementSearch, nextScreen, previousScreen;
    JTextField usernameField, addUsernameField, locationInput, addElementField;
    JPasswordField passwordField, addPasswordField;
    JComboBox addStateField;
    JTabbedPane tabbedPane, howItWorksPane;
    JFileChooser fc;
    JSpinner numberOfLines;
    File image;
    JTextArea elementsOutput;

public void addComponentToPane(Container pane) /*pane defaults to border layout*/ {
    //Creates top and bottom components
    pane.add(topBar(), BorderLayout.NORTH);
    pane.add(bottomBar(), BorderLayout.SOUTH);

    //Initalise tabbed pane.
    tabbedPane = new JTabbedPane();

    //Create the "cards".
    JPanel card1 = new JPanel();
    card1 = loginCentre();

    JPanel card2 = new JPanel();
    card2 = addUserCenter(); 

    JPanel card3 = new JPanel();
    card3 = homeScreenCenter();

    JPanel card4 = new JPanel();
    card4 = addElementCenter();

    JPanel card5 = new JPanel();
    card5 = creditsCenter();

    JPanel card6 = new JPanel();
    card6 = howItWorksPanel();

    //Place the cards into the tabbed pane.
    tabbedPane.addTab(LOGINPANEL, card1);
    tabbedPane.addTab(HOMESCREENPANEL, card3);
    tabbedPane.addTab(HOWITWORKSPANEL, card6);
    tabbedPane.addTab(ADDELEMENTPANEL, card4);
    tabbedPane.addTab(ADDUSERPANEL, card2);
    tabbedPane.addTab(CREDITSPANEL, card5);
    tabbedPane.setEnabled(false);
    pane.add(tabbedPane, BorderLayout.CENTER);
}
public JPanel bottomBar(){   
    JPanel panel = new JPanel();
    JLabel label = new JLabel("Copyright held by: Space Angels Network");
    label.setAlignmentX(Component.LEFT_ALIGNMENT);
    panel.add(label);
    return panel;
}
public JPanel topBar(){
    JPanel panel = new JPanel();

    JLabel title = new JLabel(SOFTWARENAME);
    title.setHorizontalAlignment(SwingConstants.CENTER);
    title.setFont(new Font("Castellar",Font.PLAIN, 18));
    panel.add(title);

    panel.add(Box.createRigidArea(new Dimension(500,0)));

    JLabel label = new JLabel("");
    ImageIcon icon = new ImageIcon(getClass().getResource("Resources\\logo.jpg"));
    label.setIcon(icon); 
    label.setHorizontalAlignment(SwingConstants.RIGHT);
    panel.add(label);

    return panel;
}
public JPanel howItWorksPanel(){
    howItWorksPane = new JTabbedPane();
    JPanel[] screen = new JPanel[5];
    JLabel[] title = new JLabel[5];
    JLabel[] icons = new JLabel[5];
    ImageIcon[] icon = new ImageIcon[5];
    nextScreen = new JButton("Next");
    previousScreen = new JButton("Previous");

    //constructor
    for (int i = 0; i < title.length; i++){
        title[i] = new JLabel("");
        icons[i] = new JLabel("");
        screen[i] = new JPanel();
        screen[i].setSize(600,400);
        title[i].setFont(new Font("Segoe Print", Font.PLAIN,12));
    }

    //Screen 0
    screen[0].setLayout(new GridBagLayout());
    title[0].setText("Press next to see how spectral analysis works!");
    title[0].setFont(new Font("Imprint MT Shadow",Font.BOLD,20));
    screen[0].add(title[0]);

    //Screen 1
    title[1].setText("<html>White light is made up of many different colours. <BR>When this light "
            + "enters a glass prism, the various <BR>wavelengths of the different colours refract<BR>independently this "
            + "causes the colour to break down <BR>into a spectra of colours:</HTML>");
    icon[1] = new ImageIcon(getClass().getResource("Resources\\prism_1.gif"));
    icons[1].setIcon(icon[1]);
    screen[1].add(title[1]);
    screen[1].add(Box.createRigidArea(new Dimension(100,0)));
    screen[1].add(icons[1]);

    //Screen 2
    title[2].setText("<HTML>This 'wave like' nature of light can also be seen<BR>within stars. When light"
            + " from a star enters a glass prism<BR>the same affect can be seen. However, there are<BR>black lines on the"
            + " spectra, these lines correspond<BR>to the different elements found within the star:</HTML>");
    icon[2] = new ImageIcon(getClass().getResource("Resources\\star-emission-spec.gif"));
    icons[2].setIcon(icon[2]);
    screen[2].add(title[2]);
    screen[2].add(icons[2]);

    //Screen 3
    title[3].setText("<HTML>We can compare these 'Emission Spectras' with <BR>elements absorption spectras"
            + " to determine the <BR>composition of a star. Different elements are<BR>able to absorb photons, ('packets'"
            + " of light) of different<BR>wavelengths. Once a photon has been absorbed, it then<BR>needs to be re-emmitted, "
            + "the odds of it being<BR>re-emmitted in the exact same direction<BR>is none existant, this causes the black lines.</HTML>");
    icon[3] = new ImageIcon(getClass().getResource("Resources\\star-emission.gif"));
    icon[3].getImage().flush();
    icons[3].setIcon(icon[3]);
    screen[3].add(title[3]);
    screen[3].add(icons[3]);

    //Screen 4
    title[4].setText("<HTML>As you can see from this picture, we can detect<BR>that Hydrogen and Mercury"
            + " are within the star.<BR>This software automates this process, <BR>providing a more accurate comparison."
            + " It is also able<BR>to quickly examine a very large array of elements, much faster<BR>and more accuratly"
            + " than humans.<BR>For example, the output for this spectra is:<BR>Hydrogen, with a percentage uncertainty of 1%, and<BR>"
            + "Mercury with a percentage uncertainty of 3%.</HTML>");
    icon[4] = new ImageIcon(getClass().getResource("Resources\\Hydrogen Mercury.jpg"));
    icons[4].setIcon(icon[4]);
    screen[4].add(title[4]);
    screen[4].add(icons[4]);

    nextScreen.addActionListener(this);
    previousScreen.addActionListener(this);

    howItWorksPane.add("Home", screen[0]);
    howItWorksPane.add("The Wave-Like Nature of Light", screen[1]);
    howItWorksPane.add("Stars and Light", screen[2]);
    howItWorksPane.add("The Particle Nature of Light", screen[3]);
    howItWorksPane.add("Spectral Analysis", screen[4]);

    JPanel center = new JPanel();
    center.setLayout(new BoxLayout(center, BoxLayout.PAGE_AXIS));
    center.add(howItWorksPane);
    JPanel centerMinor = new JPanel();
    centerMinor.add(previousScreen);
    centerMinor.add(Box.createRigidArea(new Dimension(700,0)));
    centerMinor.add(nextScreen);
    center.add(centerMinor);
    return center;
}
public JPanel addUserCenter(){
    //Initialise
    JLabel name = new JLabel("Username:");
    addUsernameField = new JTextField("username");
    JLabel pass = new JLabel("Password:");
    addPasswordField = new JPasswordField(10);
    JLabel st = new JLabel("State:");
    String[] states = {"General User", "Scientist", "Admin"};
    addStateField = new JComboBox(states);
    addUserButton = new JButton("Add User");
    JPanel screen = new JPanel();

    //Layout the objects
    screen.setLayout(new BoxLayout(screen, BoxLayout.PAGE_AXIS));
    screen.setBorder(new TitledBorder("Add User"));
    name.setAlignmentX(Component.RIGHT_ALIGNMENT);
    addUsernameField.setAlignmentX(Component.CENTER_ALIGNMENT);
    pass.setAlignmentX(Component.RIGHT_ALIGNMENT);
    addPasswordField.setAlignmentX(Component.CENTER_ALIGNMENT);
    addUserButton.setAlignmentX(Component.LEFT_ALIGNMENT);
    st.setAlignmentX(Component.RIGHT_ALIGNMENT);
    addUserButton.addActionListener(this);

    //Create the panel
    screen.add(name);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(addUsernameField);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(pass);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(addPasswordField);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(st);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(addStateField);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(addUserButton);

    //Put the panel onto the screen
    JPanel fin = new JPanel();
    fin.setSize(600, 400);
    fin.add(Box.createRigidArea(new Dimension(0,100)));
    fin.add(screen);
    return fin;
}   
public JPanel loginCentre(){
    //init
    JLabel name = new JLabel("Username:");
    usernameField = new JTextField("username");
    JLabel pass = new JLabel("Password:");
    passwordField = new JPasswordField("password");
    loginButton = new JButton("login");
    JPanel screen = new JPanel();

    //Maneuver objects
    screen.setLayout(new BoxLayout(screen, BoxLayout.PAGE_AXIS));
    screen.setBorder(new TitledBorder("login"));
    name.setAlignmentX(Component.RIGHT_ALIGNMENT);
    usernameField.setAlignmentX(Component.CENTER_ALIGNMENT);
    pass.setAlignmentX(Component.RIGHT_ALIGNMENT);
    passwordField.setAlignmentX(Component.CENTER_ALIGNMENT);
    loginButton.setAlignmentX(Component.LEFT_ALIGNMENT);

    loginButton.addActionListener((ActionListener) this);

    //Create panel
    screen.add(name);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(usernameField);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(pass);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(passwordField);
    screen.add(Box.createRigidArea(new Dimension(0,10)));
    screen.add(loginButton);

    //Place panel onto screen
    JPanel fin = new JPanel();
    fin.setSize(600, 400);
    fin.add(Box.createRigidArea(new Dimension(0,100)));
    fin.add(screen);

    return fin;
}  
public JPanel homeScreenCenter(){
    locationInput = new JTextField("E:\\Computing Project\\ImageID\\src\\prototype1\\images\\perfectHydrogenHelium.png");
    searchForEmission = new JButton("Find File");
    starButton = new JButton("Inspect Star");
    elementsOutput = new JTextArea("Select an emission spectrum\nClick the Inspect Star button\n\n\n\n");
    elementsOutput.setSize(100, 400);
    label = new JLabel("");

    searchForEmission.addActionListener(this);
    starButton.addActionListener(this);

    JPanel getFile = new JPanel();
    getFile.add(label);
    getFile.add(locationInput);
    getFile.add(searchForEmission);
    getFile.setBorder(new TitledBorder("Select File"));

    JPanel output = new JPanel();
    output.add(starButton);
    output.add(Box.createRigidArea(new Dimension(100,0)));
    output.add(elementsOutput);

    JPanel fin = new JPanel();
    fin.setLayout(new BoxLayout(fin, BoxLayout.PAGE_AXIS));
    fin.setSize(600, 400);
    fin.add(getFile);
    fin.add(output);
    return fin;
}
public JPanel addElementCenter(){
    //Initialise
    JLabel label1 = new JLabel("Enter element name:");
    label1.setAlignmentX(Component.RIGHT_ALIGNMENT);
    JLabel label3 = new JLabel("Enter the number of spectral lines:");
    addElementField = new JTextField("Element");
    addElementField.setColumns(15);
    elementButton = new JButton("Add Element");
    label2 = new JLabel("");
    numberOfLines = new JSpinner(new SpinnerNumberModel(0,0,100,1));

    //Set up buttons and text fields.
    elementButton.setAlignmentX(Component.RIGHT_ALIGNMENT);
    elementButton.addActionListener(this);
    locationInput = new JTextField("E:\\\\Computing Project\\\\ImageID\\\\src\\\\prototype1\\\\images\\\\Helium.png");
    locationInput.setColumns(40);
    addElementSearch = new JButton("Find File");
    addElementSearch.addActionListener(this);

    //Create a panel for the get File section
    JPanel getFile = new JPanel();
    getFile.add(locationInput);
    getFile.add(Box.createRigidArea(new Dimension(100,0)));
    getFile.add(addElementSearch);
    getFile.add(label2);
    getFile.setBorder(new TitledBorder("Select File"));

    //Create a sub panel to get the name information
    JPanel getName = new JPanel();
    getName.add(label1);
    getName.add(addElementField);

    //Create a sub panel to get the number of spectral lines.
    JPanel getLines = new JPanel();
    getLines.add(label3);
    getLines.add(numberOfLines);

    //Combines the two sub panels into one panel.
    JPanel getValues = new JPanel();
    getValues.setLayout(new BoxLayout(getValues, BoxLayout.PAGE_AXIS));
    getValues.add(getName);
    getValues.add(getLines);

    //Puts the button into a panel, and made to be to the right of the panel.
    JPanel button = new JPanel();
    button.add(Box.createRigidArea(new Dimension(700,0)));
    button.add(elementButton);

    //Creates a master panel which combines all the different features.
    JPanel center = new JPanel();
    center.setLayout(new BorderLayout());
    center.add(getValues, BorderLayout.NORTH);
    center.add(getFile, BorderLayout.CENTER);
    center.add(button, BorderLayout.SOUTH);
    return center;
}
private JPanel creditsCenter(){
    JPanel panel = new JPanel();
    panel.setBorder(new TitledBorder("Space Angels Network"));

    JTextArea text = new JTextArea("Made and Designed by:\n\tSamuel Brotherton. \nWith Valued Insight From: \n       "
            + "\tMr J.Levermore,\n\tMr I.Clause,\n\tMr S.Parker.");
    text.setColumns(20);
    text.setBackground(new Color(0, 0, 0, 0));
    text.setEditable(false);
    JLabel label = new JLabel("");
    ImageIcon icon = new ImageIcon(getClass().getResource("Resources\\logo.jpg"));
    label.setIcon(icon);

    panel.add(label);
    panel.add(Box.createRigidArea(new Dimension(50,0)));
    panel.add(text);

    JPanel finalPanel = new JPanel();
    finalPanel.setLayout(new GridBagLayout());
    finalPanel.add(panel);
    return finalPanel;
}
private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame(SOFTWARENAME);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    GraphicalUserInterface gui = new GraphicalUserInterface();
    gui.addComponentToPane(frame.getContentPane());

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}
public static void main(String[] args) {
    /* Use an appropriate Look and Feel */
    try {
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {
        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use of bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);

    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });
}
@Override
public void actionPerformed(ActionEvent e) {
    LoginDetails login = new LoginDetails();
    MainCode star = new MainCode();
    if(e.getSource() == loginButton){
        username = usernameField.getText();
        username = username.toUpperCase();
        //If the username and password match
        if (login.login(username, passwordField.getText())){
            tabbedPane.setEnabled(true);
            state = login.getState(username);
            switch(state){
                case 0: //General user 
                    tabbedPane.setEnabledAt(4, false);
                    tabbedPane.setEnabledAt(3, false);
                    break;
                case 1: //Scientist
                    tabbedPane.setEnabledAt(3, true);
                    tabbedPane.setEnabledAt(4, false);
                    break;
                case 2:
                    tabbedPane.setEnabledAt(3, true);
                    tabbedPane.setEnabledAt(4, true);
                    break;
            }
            tabbedPane.setSelectedIndex(1);
        } else {
            JOptionPane.showMessageDialog(null, "INCORRECT USER-PASSWORD COMBINATION!", "ACCESS DENIED", JOptionPane.ERROR_MESSAGE);
            username = "";
        }
    } else if (e.getSource() == addUserButton){
        User user = new User(addUsernameField.getText(), addPasswordField.getText(), (int) addStateField.getSelectedIndex());
        login.addToFile(user);
    } else if (e.getSource() == searchForEmission ||e.getSource() == addElementSearch){
        JButton open = new JButton("Open");
        fc = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter("Images", "jpg", "gif", "png");
        fc.addChoosableFileFilter(filter);
        fc.setAcceptAllFileFilterUsed(false);
        fc.setCurrentDirectory(new File(".\\build\\classes\\Prototype1\\Resources"));
        //The title needs to change depending on if it is the file chooser for emission or absorption.
        if (e.getSource() == searchForEmission){
            fc.setDialogTitle("Select Emmission Spectrum");
        } else {
            fc.setDialogTitle("Select Absorption Spectrum");
        }
        fc.setFileView(new ImageFileView());
        fc.setAccessory(new ImagePreview(fc));
        //If an appropriate image is selected, we need to input the file path to the label, and put the image in the file.
        if(fc.showOpenDialog(open) == JFileChooser.APPROVE_OPTION){
            File selectedFile = fc.getSelectedFile();
            locationInput.setText(selectedFile.getAbsolutePath());
            ImageIcon img = new ImageIcon(selectedFile.getAbsolutePath());
            img = new ImageIcon(img.getImage().getScaledInstance(700, 100, Image.SCALE_DEFAULT));
            if(tabbedPane.getSelectedIndex() == 1){
                label.setIcon(img);
            } else {
                label2.setIcon(img);
            }
            image = selectedFile;
        }
    } else if (e.getSource() == starButton){
        String path = "";
        //If there is no image, then run the code of the text field.
        if (image == null && locationInput.getText() != null){
            path = locationInput.getText();
        } else if (image != null){
            path = image.getAbsolutePath();
        }
        ArrayList<KnownElements> elements = star.checkStarFunction(path, 0);
            String text = "Elements within this star:\n";
            //Output data about each element.
            for (int i = 0; i < elements.size(); i++){
                NumberFormat pc = NumberFormat.getPercentInstance();
                if (state != 0){
                    text += elements.get(i).getName() + "\n" + "With a percentage uncertanty of " + pc.format(elements.get(i).getGreatestPercent()) + "\n";
                } else {
                    text += elements.get(i).getName() + "\n";
                }
            }
            elementsOutput.setText(text);
    } else if (e.getSource() == elementButton){
        String path = "";
        //If the image is not entered than run code of text field, otherwise use image.
        if (image == null && locationInput.getText() != null && addElementField.getText() != null){
            path = locationInput.getText();
            //This just confirms that the user wants to add the element as there is no function to remove an element.
            if (JOptionPane.showConfirmDialog(null, "Are you sure you want to add the element: " + addElementField.getText()) == JOptionPane.YES_OPTION){
                star.addElementFunction(addElementField.getText(), path, (int) numberOfLines.getValue());
                JOptionPane.showMessageDialog(null, "Element successfully added!");
            }
        } else if (image != null){
            path = image.getAbsolutePath();
            if (JOptionPane.showConfirmDialog(null, "Are you sure you want to add the element: " + addElementField.getText()) == JOptionPane.YES_OPTION){
                star.addElementFunction(addElementField.getText(), path, (int) numberOfLines.getValue());
                JOptionPane.showMessageDialog(null, "Element successfully added!");
            }
        }
    } else if (e.getSource() == nextScreen){
        index = howItWorksPane.getSelectedIndex() + 1;
        index %= howItWorksPane.getTabCount();
        howItWorksPane.setSelectedIndex(index);
    } else if (e.getSource() == previousScreen){
        index = howItWorksPane.getSelectedIndex() - 1;
        index %= howItWorksPane.getTabCount();
        //Jave mod function if between 0 and -2, will return a negative integer.
        if (index < 0) {
            index += howItWorksPane.getTabCount();
        }
        howItWorksPane.setSelectedIndex(index);
    }
}
Community
  • 1
  • 1
  • 1
    The stack trace clearly shows that the construction of the ImageIcon is failing because its argument, getClass().getResource("Resources\\filename.jpg"), returns null. Arguments to `getResource` should *always* use `/` as a file separator, on *all platforms.* – VGR Oct 30 '16 at 22:44
  • Ohh okay thank you, it's weird that the ide is allowing me to use \ then? – Sam Brotherton Oct 30 '16 at 23:36
  • It worked! Thank you so much man! Still weird that it would allow for me to use \ but ohh well, I guess that is a habit I need to get out of, thank you. – Sam Brotherton Oct 30 '16 at 23:44
  • Okay sorry to bother you, when I loaded up my file chooser, it used to take me into the resources folder, but now it is not, it just takes me to my documents, any reason why? Also my text files are not working. – Sam Brotherton Oct 30 '16 at 23:55
  • According to [the documentation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JFileChooser.html#JFileChooser--) it should always start in My Documents. As for your text files, I suggest you ask a new question. Make sure you provide more information than just “files are not working”; describe what you expect to see and what you are seeing instead. – VGR Oct 31 '16 at 01:15
  • Okay will do, thank you for the help! Just in case your curious, I mainly fixed it, I was using a file reader rather than an input stream reader, from http://stackoverflow.com/questions/2271926/how-to-read-a-file-from-a-jar-file – Sam Brotherton Oct 31 '16 at 01:33

0 Answers0