topPanel.setLayout(new java.awt.FlowLayout());
parentsPanel.add(buttonPanel); topPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 0));
  public void installComponents(JFileChooser fc)  {    JLabel look = new JLabel("Look In:");    parents = new JComboBox();    parents.setRenderer(new CBLabelRenderer());    boxEntries();    look.setLabelFor(parents);    JPanel parentsPanel = new JPanel();    parentsPanel.add(look);    parentsPanel.add(parents);    JPanel buttonPanel = new JPanel();    upFolderButton = new JButton();    upFolderButton.setIcon(upFolderIcon);    buttonPanel.add(upFolderButton);    homeFolderButton = new JButton();    homeFolderButton = new JButton(homeFolderIcon);    buttonPanel.add(homeFolderButton);    newFolderButton = new JButton();    newFolderButton.setIcon(newFolderIcon);    buttonPanel.add(newFolderButton);    ButtonGroup toggles = new ButtonGroup();    JToggleButton listViewButton = new JToggleButton();    listViewButton.setIcon(listViewIcon);    toggles.add(listViewButton);    buttonPanel.add(listViewButton);    JToggleButton detailsViewButton = new JToggleButton();    detailsViewButton.setIcon(detailsViewIcon);    toggles.add(detailsViewButton);    buttonPanel.add(detailsViewButton);    JPanel topPanel = new JPanel();    topPanel.setLayout(new java.awt.FlowLayout());    topPanel.add(parentsPanel);    topPanel.add(buttonPanel);    accessoryPanel = new JPanel();    if (filechooser.getAccessory() != null)      accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER);    filelist = new JList(model);    filelist.setVisibleRowCount(6);    JScrollPane scrollp = new JScrollPane(filelist);    scrollp.setPreferredSize(new Dimension(400, 175));    filelist.setBackground(Color.WHITE);    filelist.setLayoutOrientation(JList.VERTICAL_WRAP);    filelist.setCellRenderer(new ListLabelRenderer());    GridBagConstraints c = new GridBagConstraints();    c.gridx = 0;    c.gridy = 0;    c.fill = GridBagConstraints.BOTH;    c.weightx = 1;    c.weighty = 1;    JPanel centrePanel = new JPanel();    centrePanel.setLayout(new GridBagLayout());    centrePanel.add(scrollp, c);    c.gridx = 1;    centrePanel.add(accessoryPanel, c);    JLabel fileNameLabel = new JLabel("File Name:");    JLabel fileTypesLabel = new JLabel("Files of Type:");    entry = new JTextField();    filters = new JComboBox();    filterEntries();    fileNameLabel.setLabelFor(entry);    fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT);    fileTypesLabel.setLabelFor(filters);    fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT);    closePanel = new JPanel();    accept = getApproveButton(filechooser);    cancel = new JButton(cancelButtonText);    cancel.setMnemonic(cancelButtonMnemonic);    cancel.setToolTipText(cancelButtonToolTipText);    closePanel.add(accept);    closePanel.add(cancel);    c.anchor = GridBagConstraints.WEST;    c.weighty = 0;    c.weightx = 0;    c.gridx = 0;    bottomPanel = new JPanel();    bottomPanel.setLayout(new GridBagLayout());    bottomPanel.add(fileNameLabel, c);    c.gridy = 1;    bottomPanel.add(fileTypesLabel, c);    c.gridx = 1;    c.gridy = 0;    c.weightx = 1;    c.weighty = 1;    bottomPanel.add(entry, c);    c.gridy = 1;    bottomPanel.add(filters, c);    c.fill = GridBagConstraints.NONE;    c.gridy = 2;    c.anchor = GridBagConstraints.EAST;    bottomPanel.add(closePanel, c);    filechooser.setLayout(new BorderLayout());    filechooser.add(topPanel, BorderLayout.NORTH);    filechooser.add(centrePanel, BorderLayout.CENTER);    filechooser.add(bottomPanel, BorderLayout.SOUTH);  }