private JFileChooser chooser = JFileChoosers.create();
public FilePanel(LogFrame frame) {
super(frame);
JPanel filePanel = new JPanel(new GridBagLayout());
GridBagLayout gb = (GridBagLayout) filePanel.getLayout();
GridBagConstraints gc = new GridBagConstraints();
gc.fill = GridBagConstraints.HORIZONTAL;
gb.setConstraints(fileLabel, gc);
filePanel.add(fileLabel);
gc.weightx = 1.0;
gb.setConstraints(fileField, gc);
filePanel.add(fileField);
gc.weightx = 0.0;
gb.setConstraints(selectButton, gc);
filePanel.add(selectButton);
fileField.setEditable(false);
fileField.setEnabled(false);
setLayout(new GridBagLayout());
gb = (GridBagLayout) getLayout();
gc = new GridBagConstraints();
gc.gridx = 0;
gc.weightx = 1.0;
gc.gridy = GridBagConstraints.RELATIVE;
JComponent glue;
glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
gb.setConstraints(enableLabel, gc); add(enableLabel);
gb.setConstraints(enableButton, gc); add(enableButton);
glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
gc.fill = GridBagConstraints.HORIZONTAL;
gb.setConstraints(filePanel, gc); add(filePanel);
gc.fill = GridBagConstraints.NONE;
glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
gb.setConstraints(headerCheckBox, gc); add(headerCheckBox);
glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
enableButton.addActionListener(listener);
selectButton.addActionListener(listener);
headerCheckBox.addActionListener(listener);
modelChanged(null, getModel());