Example usage for java.awt FlowLayout FlowLayout

List of usage examples for java.awt FlowLayout FlowLayout

Introduction

In this page you can find the example usage for java.awt FlowLayout FlowLayout.

Prototype

public FlowLayout() 

Source Link

Document

Constructs a new FlowLayout with a centered alignment and a default 5-unit horizontal and vertical gap.

Usage

From source file:fedroot.dacs.swingdemo.DemoFrame.java

/**
 * /*from   ww  w.ja  va 2  s . com*/
 * @param dacsClientContext
 * @param feduri 
 * @throws java.lang.Exception 
 */
public DemoFrame(DacsClientContext dacsClientContext, Federation federation) throws Exception {
    logger.log(Level.INFO, "Federation {0}", federation.getFederationName());

    this.federation = federation;
    this.dacsClientContext = dacsClientContext;
    //        this.dacsClientContext.setDacs902EventHandler(federation, new Event902Handler(this));
    //        this.dacsClientContext.setDacs905EventHandler(federation, new Event905Handler(this));

    JPanel mainPanel = new JPanel(new BorderLayout());
    JPanel gotoUrlPanel = new JPanel(new FlowLayout());
    JPanel actionPanel = new JPanel(new FlowLayout());
    JPanel modifiersPanel = new JPanel(new FlowLayout());

    /** Enable/Disable DACS Check_only mode */
    checkOnlyCheckBox = new JCheckBox("Enable DACS Check Only", false);
    checkOnlyCheckBox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent ae) {
            if (checkOnlyCheckBox.isSelected()) {
                enableEventHandlingCheckBox.setSelected(false);
                enableEventHandlingCheckBox.setEnabled(false);
            } else {
                enableEventHandlingCheckBox.setEnabled(true);
            }
        }
    });

    /** Enable/Disable Event Handling */
    enableEventHandlingCheckBox = new JCheckBox("Enable Event Handling", false);

    final JButton btnGOTO = new JButton("Goto URL");
    btnGOTO.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent ae) {
            try {
                followUrl(new URI(urlTextField.getText().trim()));
            } catch (URISyntaxException ex) {
                // TODO implement popup for error messages
            }
        }
    });

    final JButton btnGO = new JButton("GO");
    btnGO.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent ae) {
            try {
                followUrl(new URI(actionUrls[actionsComboBox.getSelectedIndex()]));
            } catch (URISyntaxException ex) {
                // TODO implement popup for error messages
            }
        }
    });

    final JButton btnUSERNAMES = new JButton("Usernames");
    btnUSERNAMES.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent ae) {
            createAndShowDacsUsernameFrame();
        }
    });

    final JButton btnLOGIN = new JButton("Login");
    btnLOGIN.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent ae) {
            createAndShowLoginFrame();
        }
    });

    final JButton btnNAT = new JButton("NATs");
    btnNAT.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent ae) {
            createAndShowDacsNatFrame();
        }
    });

    Container container = this.getContentPane();

    actionsComboBox = new JComboBox(actions);
    actionsComboBox.setToolTipText("Select an Action");
    actionsComboBox.setEditable(true);
    actionsComboBox.setSelectedIndex(0);

    JLabel actionLabel = new JLabel("Action:");

    urlTextField = new TextField(70);
    urlTextField.setEditable(true);

    gotoUrlPanel.add(urlTextField);
    gotoUrlPanel.add(btnGOTO);

    actionPanel.add(actionLabel);
    actionPanel.add(actionsComboBox);
    actionPanel.add(btnGO);
    actionPanel.add(btnLOGIN);
    actionPanel.add(btnUSERNAMES);
    actionPanel.add(btnNAT);

    mainPanel.add(gotoUrlPanel, BorderLayout.NORTH);
    mainPanel.add(actionPanel, BorderLayout.SOUTH);

    modifiersPanel.add(checkOnlyCheckBox);
    modifiersPanel.add(enableEventHandlingCheckBox);

    JSplitPane splitInputPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, mainPanel, modifiersPanel);

    splitInputPane.setOneTouchExpandable(false);

    responseTextArea = new JTextArea();
    responseTextArea.setEditable(false);
    responseTextArea.setCaretPosition(0);

    htmlPane = new JEditorPane();
    // htmlPane.setContentType("image/png");
    htmlPane.setEditable(false);

    JSplitPane splitResponsePane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(responseTextArea),
            new JScrollPane(htmlPane));
    splitResponsePane.setOneTouchExpandable(false);
    splitResponsePane.setResizeWeight(0.35);

    container.setLayout(new BorderLayout());
    container.add(splitInputPane, BorderLayout.NORTH);
    container.add(splitResponsePane, BorderLayout.CENTER);
}

From source file:org.cytoscape.dyn.internal.graphMetrics.GraphMetricsResultsPanel.java

/**
 * /*from  w  w w .j  ava2s .co m*/
 */
public void initComponents() {
    enlargeButton = new JButton("Enlarge Chart");
    enlargeButton.addActionListener(this);
    enlargeButton.setToolTipText("View chart in a new window.");
    saveChartButton = new JButton("Save Chart");
    saveChartButton.addActionListener(this);
    saveChartButton.setToolTipText("Save the chart as a .jpg/.png/.svg file.");
    saveDataButton = new JButton("Save Data");
    saveDataButton.addActionListener(this);
    saveDataButton.setToolTipText("Save data in a file.");
    closeTabButton = new JButton("Close Tab");
    closeTabButton.addActionListener(this);
    closeTabButton.setToolTipText("Close this tab.");
    helpButton = new JButton("Help");
    helpButton.setToolTipText("Get help!");
    helpButton.addActionListener(this);
    buttonsPanel = new JPanel();
    chartPanel = new ChartPanel(this.timeSeries);
    buttonsPanel.add(enlargeButton);
    buttonsPanel.add(saveChartButton);
    buttonsPanel.add(saveDataButton);
    buttonsPanel.add(closeTabButton);
    buttonsPanel.add(helpButton);
    buttonsPanel.setLayout(new FlowLayout());
    this.add(chartPanel);
    this.add(buttonsPanel);
    this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    this.setVisible(true);
}

From source file:org.cytoscape.dyn.internal.graphMetrics.GraphMetricsPanel.java

public GraphMetricsPanel(org.cytoscape.dyn.internal.CyActivator<T, C> cyActivator,
        DynNetwork<T> dynamicNetwork) {

    this.cyactivator = cyActivator;
    this.dynamicNetwork = dynamicNetwork;
    attributesTable = new JTable(new MyTableModel(dynamicNetwork.getNodeAttributes()));
    attributesTable.setPreferredScrollableViewportSize(new Dimension(300, 400));
    attributesTable.setFillsViewportHeight(true);
    attributesTable.setShowGrid(false);/*from   w w  w.jav  a  2  s. c  o m*/
    JScrollPane tablePanel = new JScrollPane(attributesTable);
    tablePanel.setSize(new Dimension(250, 400));

    edgeAttributesTable = new JTable(new MyTableModel(dynamicNetwork.getEdgeAttributes()));
    edgeAttributesTable.setPreferredScrollableViewportSize(new Dimension(300, 400));
    edgeAttributesTable.setFillsViewportHeight(true);
    edgeAttributesTable.setShowGrid(false);
    JScrollPane edgeTablePanel = new JScrollPane(edgeAttributesTable);
    edgeTablePanel.setSize(new Dimension(250, 400));

    plotChartButton = new JButton("Plot Selected Attributes");
    closeTab = new JButton("Close Tab");

    plotChartButton.addActionListener(this);
    closeTab.addActionListener(this);

    buttonPanel = new JPanel();

    buttonPanel.setLayout(new FlowLayout());

    buttonPanel.add(plotChartButton);
    buttonPanel.add(closeTab);
    buttonPanel.setBorder(BorderFactory.createTitledBorder(null, "Options", TitledBorder.DEFAULT_JUSTIFICATION,
            TitledBorder.DEFAULT_POSITION, new Font("SansSerif", 0, 12), Color.darkGray));

    tablePanel.setBorder(
            BorderFactory.createTitledBorder(null, "Node Attributes", TitledBorder.DEFAULT_JUSTIFICATION,
                    TitledBorder.DEFAULT_POSITION, new Font("SansSerif", 0, 12), Color.darkGray));

    edgeTablePanel.setBorder(
            BorderFactory.createTitledBorder(null, "Edge Attributes", TitledBorder.DEFAULT_JUSTIFICATION,
                    TitledBorder.DEFAULT_POSITION, new Font("SansSerif", 0, 12), Color.darkGray));

    GroupLayout cytoLayout = new GroupLayout(this);
    this.setLayout(cytoLayout);
    this.add(tablePanel);
    this.add(buttonPanel);

    cytoLayout.setHorizontalGroup(cytoLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addComponent(tablePanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
            .addComponent(edgeTablePanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
            .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE));
    cytoLayout.setVerticalGroup(
            cytoLayout.createSequentialGroup().addComponent(tablePanel, 200, GroupLayout.DEFAULT_SIZE, 300)
                    .addComponent(edgeTablePanel, 200, GroupLayout.DEFAULT_SIZE, 300)
                    .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE));

    this.setVisible(true);
}

From source file:gui.images.ClassHubsPanel.java

/**
 * Creates new form ClassHubsPanel/*from  w ww  .  j  a  v  a  2 s. c o m*/
 */
public ClassHubsPanel(Color classColor, String className) {
    initComponents();
    hubsPanel.setLayout(new FlowLayout());
    badHubsPanel.setLayout(new FlowLayout());
    goodHubsPanel.setLayout(new FlowLayout());
    this.setBackground(classColor);
    this.classNameLabel.setText(className);
    classNameLabel.repaint();
    pointTypePanel.setLayout(new FlowLayout());
    pointTypePanel.setPreferredSize(new Dimension(318, 262));
    pointTypePanel.setMaximumSize(new Dimension(318, 262));
    pointTypePanel.setMinimumSize(new Dimension(318, 262));
}

From source file:net.sf.profiler4j.console.ProjectDialog.java

/**
 * This method initializes jPanel// w ww  .  j a  v  a  2  s  . c o  m
 * 
 * @return javax.swing.JPanel
 */
private JPanel getJPanel() {
    if (jPanel == null) {
        FlowLayout flowLayout = new FlowLayout();
        flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
        jPanel = new JPanel();
        jPanel.setLayout(flowLayout);
        jPanel.add(getOkButton(), null);
        jPanel.add(getJButton(), null);
    }
    return jPanel;
}

From source file:org.jfree.chart.demo.SecondaryDatasetDemo2.java

/**
 * Constructs a new demonstration application.
 *
 * @param title  the frame title.//  w  w  w  .j  a  va2s . c o m
 */
public SecondaryDatasetDemo2(final String title) {

    super(title);
    final CategoryDataset dataset1 = createRandomDataset("Series 1");
    final JFreeChart chart = ChartFactory.createLineChart("Secondary Dataset Demo 2", "Category", "Value",
            dataset1, PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.white);

    this.plot = chart.getCategoryPlot();
    this.plot.setBackgroundPaint(Color.lightGray);
    this.plot.setDomainGridlinePaint(Color.white);
    this.plot.setRangeGridlinePaint(Color.white);
    //        this.plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 4, 4, 4, 4));

    final NumberAxis rangeAxis = (NumberAxis) this.plot.getRangeAxis();
    rangeAxis.setAutoRangeIncludesZero(false);

    final JPanel content = new JPanel(new BorderLayout());

    final ChartPanel chartPanel = new ChartPanel(chart);
    content.add(chartPanel);

    final JButton button1 = new JButton("Add Dataset");
    button1.setActionCommand("ADD_DATASET");
    button1.addActionListener(this);

    final JButton button2 = new JButton("Remove Dataset");
    button2.setActionCommand("REMOVE_DATASET");
    button2.addActionListener(this);

    final JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(button1);
    buttonPanel.add(button2);

    content.add(buttonPanel, BorderLayout.SOUTH);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(content);

}

From source file:com.ibm.watson.WatsonVRTraining.util.images.PhotoCaptureFrame.java

PhotoCaptureFrame() {
    jp = new JPanel();
    jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));

    JScrollPane scrollPane = new JScrollPane(jp);
    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    scrollPane.setPreferredSize(new Dimension(dim.width / 2 - 40, dim.height - 117));

    JButton btn = new JButton("Upload Image");

    btn.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            JFileChooser fc = new JFileChooser(System.getenv("user.home"));
            fc.setFileFilter(new JPEGImageFileFilter());
            int res = fc.showOpenDialog(null);
            // We have an image!
            try {
                if (res == JFileChooser.APPROVE_OPTION) {
                    File file = fc.getSelectedFile();
                    //SharedResources.sharedCache.getCapturedImageList().add(file);
                    File tmpf_name = File.createTempFile("tmp",
                            "." + FilenameUtils.getExtension(file.getName()));
                    System.out.println("cp " + file.getPath() + " " + AppConstants.vr_process_img_dir_path
                            + File.separator + tmpf_name.getName());
                    new CommandsUtils().executeCommand("bash", "-c", "cp " + file.getPath() + " "
                            + AppConstants.vr_process_img_dir_path + File.separator + tmpf_name.getName());
                }// w w  w. j av  a 2s  .c  om
            } catch (Exception iOException) {
            }

        }
    });

    ImageRemainingProcessingLabel = new JLabel("REMAINIG IMAGES:0");
    ImageRemainingProcessingLabel.setHorizontalAlignment(SwingConstants.LEFT);
    ImageRemainingProcessingLabel.setFont(new Font("Arial", Font.BOLD, 13));

    ImagebeingProcessedLabel = new JLabel(" PROCESSING IMAGES:0");
    ImagebeingProcessedLabel.setHorizontalAlignment(SwingConstants.LEFT);
    ImagebeingProcessedLabel.setFont(new Font("Arial", Font.BOLD, 13));

    appIDLabel = new JLabel("APP-ID:" + AppConstants.unique_app_id);
    appIDLabel.setHorizontalAlignment(SwingConstants.LEFT);
    appIDLabel.setFont(new Font("Arial", Font.BOLD, 13));

    headerPanel = new JPanel(new FlowLayout());
    headerPanel.add(ImageRemainingProcessingLabel);
    headerPanel.add(ImagebeingProcessedLabel);
    headerPanel.add(btn);
    headerPanel.add(appIDLabel);
    headerPanel.setSize(new Dimension(getWidth(), 10));

    JPanel contentPane = new JPanel();
    contentPane.add(headerPanel);
    contentPane.add(scrollPane);
    f = new JFrame("IBM Watson Visual Prediction Window");
    f.setContentPane(contentPane);
    f.setSize(dim.width / 2 - 30, dim.height - 40);
    f.setLocation(dim.width / 2, 0);
    f.setResizable(false);
    f.setPreferredSize(new Dimension(dim.width / 2 - 30, dim.height - 60));
    f.setVisible(true);
}

From source file:org.jfree.chart.demo.SecondaryDatasetDemo1.java

/**
 * Constructs a new demonstration application.
 *
 * @param title  the frame title./*w  w w.  jav  a2  s .  c  om*/
 */
public SecondaryDatasetDemo1(String title) {

    super(title);
    TimeSeriesCollection dataset1 = createRandomDataset("Series 1");
    JFreeChart chart = ChartFactory.createTimeSeriesChart("Secondary Dataset Demo 1", "Time", "Value", dataset1,
            true, true, false);
    chart.setBackgroundPaint(Color.white);

    this.plot = chart.getXYPlot();
    this.plot.setBackgroundPaint(Color.lightGray);
    this.plot.setDomainGridlinePaint(Color.white);
    this.plot.setRangeGridlinePaint(Color.white);
    this.plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 4, 4, 4, 4));
    ValueAxis axis = this.plot.getDomainAxis();
    axis.setAutoRange(true);

    NumberAxis rangeAxis2 = new NumberAxis("Range Axis 2");
    rangeAxis2.setAutoRangeIncludesZero(false);

    JPanel content = new JPanel(new BorderLayout());

    ChartPanel chartPanel = new ChartPanel(chart);
    content.add(chartPanel);

    JButton button1 = new JButton("Add Dataset");
    button1.setActionCommand("ADD_DATASET");
    button1.addActionListener(this);

    JButton button2 = new JButton("Remove Dataset");
    button2.setActionCommand("REMOVE_DATASET");
    button2.addActionListener(this);

    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(button1);
    buttonPanel.add(button2);

    content.add(buttonPanel, BorderLayout.SOUTH);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(content);

}

From source file:org.jfree.chart.demo.MultipleDatasetDemo1.java

/**
 * Constructs a new demonstration application.
 *
 * @param title  the frame title./*from   ww  w  .  j  a  v  a2 s.c o  m*/
 */
public MultipleDatasetDemo1(final String title) {

    super(title);
    final TimeSeriesCollection dataset1 = createRandomDataset("Series 1");
    final JFreeChart chart = ChartFactory.createTimeSeriesChart("Multiple Dataset Demo 1", "Time", "Value",
            dataset1, true, true, false);
    chart.setBackgroundPaint(Color.white);

    this.plot = chart.getXYPlot();
    this.plot.setBackgroundPaint(Color.lightGray);
    this.plot.setDomainGridlinePaint(Color.white);
    this.plot.setRangeGridlinePaint(Color.white);
    //        this.plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 4, 4, 4, 4));
    final ValueAxis axis = this.plot.getDomainAxis();
    axis.setAutoRange(true);

    final NumberAxis rangeAxis2 = new NumberAxis("Range Axis 2");
    rangeAxis2.setAutoRangeIncludesZero(false);

    final JPanel content = new JPanel(new BorderLayout());

    final ChartPanel chartPanel = new ChartPanel(chart);
    content.add(chartPanel);

    final JButton button1 = new JButton("Add Dataset");
    button1.setActionCommand("ADD_DATASET");
    button1.addActionListener(this);

    final JButton button2 = new JButton("Remove Dataset");
    button2.setActionCommand("REMOVE_DATASET");
    button2.addActionListener(this);

    final JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(button1);
    buttonPanel.add(button2);

    content.add(buttonPanel, BorderLayout.SOUTH);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(content);

}

From source file:e3fraud.gui.MainWindow.java

public MainWindow() {
    super(new BorderLayout(5, 5));

    extended = false;//w  w  w .j  ava2s . co m

    //Create the log first, because the action listeners
    //need to refer to it.
    log = new JTextArea(10, 50);
    log.setMargin(new Insets(5, 5, 5, 5));
    log.setEditable(false);
    logScrollPane = new JScrollPane(log);
    DefaultCaret caret = (DefaultCaret) log.getCaret();
    caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);

    //        create the progress bar
    progressBar = new JProgressBar(0, 100);
    progressBar.setValue(progressBar.getMinimum());
    progressBar.setVisible(false);
    progressBar.setStringPainted(true);
    //Create the settings pane
    generationSettingLabel = new JLabel("Generate:");
    SpinnerModel collusionsSpinnerModel = new SpinnerNumberModel(1, 0, 3, 1);
    collusionSettingsPanel = new JPanel(new FlowLayout()) {
        @Override
        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    // collusionSettingsPanel.setLayout(new BoxLayout(collusionSettingsPanel, BoxLayout.X_AXIS));
    collusionsButton = new JSpinner(collusionsSpinnerModel);
    collusionsLabel = new JLabel("collusion(s)");
    collusionSettingsPanel.add(collusionsButton);
    collusionSettingsPanel.add(collusionsLabel);

    rankingSettingLabel = new JLabel("Rank by:");
    lossButton = new JRadioButton("loss");
    lossButton.setToolTipText("Sort sub-ideal models based on loss for Target of Assessment (high -> low)");
    gainButton = new JRadioButton("gain");
    gainButton.setToolTipText(
            "Sort sub-ideal models based on gain of any actor except Target of Assessment (high -> low)");
    lossGainButton = new JRadioButton("loss + gain");
    lossGainButton.setToolTipText(
            "Sort sub-ideal models based on loss for Target of Assessment and, if equal, on gain of any actor except Target of Assessment");
    //gainLossButton = new JRadioButton("gain + loss");
    lossGainButton.setSelected(true);
    rankingGroup = new ButtonGroup();
    rankingGroup.add(lossButton);
    rankingGroup.add(gainButton);
    rankingGroup.add(lossGainButton);
    //rankingGroup.add(gainLossButton);
    groupingSettingLabel = new JLabel("Group by:");
    groupingButton = new JCheckBox("collusion");
    groupingButton.setToolTipText(
            "Groups sub-ideal models based on the pair of actors colluding before ranking them");
    groupingButton.setSelected(false);
    refreshButton = new JButton("Refresh");
    refreshButton.addActionListener(this);

    settingsPanel = new JPanel();
    settingsPanel.setLayout(new BoxLayout(settingsPanel, BoxLayout.PAGE_AXIS));
    settingsPanel.add(Box.createRigidArea(new Dimension(0, 5)));
    settingsPanel.add(generationSettingLabel);
    collusionSettingsPanel.setAlignmentX(LEFT_ALIGNMENT);
    settingsPanel.add(Box.createRigidArea(new Dimension(0, 5)));
    settingsPanel.add(collusionSettingsPanel);
    settingsPanel.add(Box.createRigidArea(new Dimension(0, 5)));
    rankingSettingLabel.setAlignmentY(TOP_ALIGNMENT);
    settingsPanel.add(rankingSettingLabel);
    settingsPanel.add(lossButton);
    settingsPanel.add(gainButton);
    settingsPanel.add(lossGainButton);
    //settingsPanel.add(gainLossButton);
    settingsPanel.add(Box.createRigidArea(new Dimension(0, 5)));
    settingsPanel.add(groupingSettingLabel);
    settingsPanel.add(groupingButton);
    settingsPanel.add(Box.createRigidArea(new Dimension(0, 5)));
    settingsPanel.add(refreshButton);
    settingsPanel.add(Box.createRigidArea(new Dimension(0, 20)));
    progressBar.setPreferredSize(
            new Dimension(settingsPanel.getSize().width, progressBar.getPreferredSize().height));
    settingsPanel.add(progressBar);

    //Create the result tree
    root = new DefaultMutableTreeNode("No models to display");
    treeModel = new DefaultTreeModel(root);
    tree = new JTree(treeModel);
    //tree.setUI(new CustomTreeUI());
    tree.setCellRenderer(new CustomTreeCellRenderer(tree));
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setLargeModel(true);
    resultScrollPane = new JScrollPane(tree);
    tree.addTreeSelectionListener(treeSelectionListener);

    //tree.setShowsRootHandles(true);
    //Create a file chooser for saving
    sfc = new JFileChooser();
    FileFilter jpegFilter = new FileNameExtensionFilter("JPEG image", new String[] { "jpg", "jpeg" });
    sfc.addChoosableFileFilter(jpegFilter);
    sfc.setFileFilter(jpegFilter);

    //Create a file chooser for loading
    fc = new JFileChooser();
    FileFilter rdfFilter = new FileNameExtensionFilter("RDF file", "RDF");
    fc.addChoosableFileFilter(rdfFilter);
    fc.setFileFilter(rdfFilter);

    //Create the open button.  
    openButton = new JButton("Load model", createImageIcon("images/Open24.png"));
    openButton.addActionListener(this);
    openButton.setToolTipText("Load a e3value model");

    //Create the ideal graph button. 
    idealGraphButton = new JButton("Show ideal graph", createImageIcon("images/Plot.png"));
    idealGraphButton.setToolTipText("Display ideal profitability graph");
    idealGraphButton.addActionListener(this);

    Dimension thinButtonDimension = new Dimension(15, 420);

    //Create the expand subideal graph button. 
    expandButton = new JButton(">");
    expandButton.setPreferredSize(thinButtonDimension);
    expandButton.setMargin(new Insets(0, 0, 0, 0));
    expandButton.setToolTipText("Expand to show non-ideal profitability graph for selected model");
    expandButton.addActionListener(this);

    //Create the collapse sub-ideal graph button. 
    collapseButton = new JButton("<");
    collapseButton.setPreferredSize(thinButtonDimension);
    collapseButton.setMargin(new Insets(0, 0, 0, 0));
    collapseButton.setToolTipText("Collapse non-ideal profitability graph for selected model");
    collapseButton.addActionListener(this);

    //Create the generation button. 
    generateButton = new JButton("Generate sub-ideal models", createImageIcon("images/generate.png"));
    generateButton.addActionListener(this);
    generateButton.setToolTipText("Generate sub-ideal models for the e3value model currently loaded");

    //Create the chart panel
    chartPane = new JPanel();
    chartPane.setLayout(new FlowLayout(FlowLayout.LEFT));
    chartPane.add(expandButton);

    //For layout purposes, put the buttons in a separate panel
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
    buttonPanel.add(openButton);
    buttonPanel.add(Box.createRigidArea(new Dimension(20, 0)));
    buttonPanel.add(generateButton);
    buttonPanel.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonPanel.add(idealGraphButton);

    //Add the buttons, the ranking options, the result list and the log to this panel.
    add(buttonPanel, BorderLayout.PAGE_START);
    add(settingsPanel, BorderLayout.LINE_START);
    add(resultScrollPane, BorderLayout.CENTER);

    add(logScrollPane, BorderLayout.PAGE_END);
    add(chartPane, BorderLayout.LINE_END);
    //and make a nice border around it
    setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 10));
}