You don't need to add the file chooser to a panel - if you just initialize one and set it visible, it will automatically be resizable.
JFileChooser chooser = new JFileChooser();
chooser.setVisible(true);
int returnVal = chooser.showOpenDialog(null);
if (returnVal == JFileChooser.APPROVE_OPTION) {
//continue your code here
To incorporate the file chooser into the panel, try this:
JFrame frame = new JFrame();
JPanel panel = new JPanel(new BorderLayout());
JFileChooser chooser = new JFileChooser();
panel.add(chooser);
frame.add(panel);
frame.pack();
frame.setVisible(true);
I'm not sure how you used the BorderLayout before but this code works perfectly on my computer.