Example usage for java.awt BorderLayout SOUTH

List of usage examples for java.awt BorderLayout SOUTH

Introduction

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

Prototype

String SOUTH

To view the source code for java.awt BorderLayout SOUTH.

Click Source Link

Document

The south layout constraint (bottom of container).

Usage

From source file:ComboBoxTest.java

public ComboBoxFrame() {
    setTitle("ComboBoxTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    // add the sample text label

    label = new JLabel("The quick brown fox jumps over the lazy dog.");
    label.setFont(new Font("Serif", Font.PLAIN, DEFAULT_SIZE));
    add(label, BorderLayout.CENTER);

    // make a combo box and add face names

    faceCombo = new JComboBox();
    faceCombo.setEditable(true);// w ww  . jav  a2  s  .c  o  m
    faceCombo.addItem("Serif");
    faceCombo.addItem("SansSerif");
    faceCombo.addItem("Monospaced");
    faceCombo.addItem("Dialog");
    faceCombo.addItem("DialogInput");

    // the combo box listener changes the label font to the selected face name

    faceCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            label.setFont(new Font((String) faceCombo.getSelectedItem(), Font.PLAIN, DEFAULT_SIZE));
        }
    });

    // add combo box to a panel at the frame's southern border

    JPanel comboPanel = new JPanel();
    comboPanel.add(faceCombo);
    add(comboPanel, BorderLayout.SOUTH);
}

From source file:net.pandoragames.far.ui.swing.component.ButtonPanel.java

private void init(SwingConfig config, ComponentRepository componentRepository) {
    this.setLayout(new BorderLayout());
    this.add(initButtonPannel(config, componentRepository), BorderLayout.SOUTH);
}

From source file:com.naval.gui.Gui.java

/**
 * Lays out the frame by setting this Client object to take up the full
 * frame display area.//from  w ww  .  ja  v a  2  s .  c om
 */
private void layoutFrame() {
    frame.getContentPane().setLayout(new BorderLayout());
    frame.getContentPane().add(this, BorderLayout.CENTER);
    hintBar.setBorder(BorderFactory.createLoweredBevelBorder());
    hintBar.setForeground(Color.RED);
    frame.getContentPane().add(hintBar, BorderLayout.SOUTH);
    frame.validate();
}

From source file:CheckBoxTest.java

public CheckBoxFrame() {
    setTitle("CheckBoxTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    // add the sample text label

    label = new JLabel("The quick brown fox jumps over the lazy dog.");
    label.setFont(new Font("Serif", Font.PLAIN, FONTSIZE));
    add(label, BorderLayout.CENTER);

    // this listener sets the font attribute of
    // the label to the check box state

    ActionListener listener = new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            int mode = 0;
            if (bold.isSelected())
                mode += Font.BOLD;
            if (italic.isSelected())
                mode += Font.ITALIC;
            label.setFont(new Font("Serif", mode, FONTSIZE));
        }//  ww w . j a  v a2  s . c  om
    };

    // add the check boxes

    JPanel buttonPanel = new JPanel();

    bold = new JCheckBox("Bold");
    bold.addActionListener(listener);
    buttonPanel.add(bold);

    italic = new JCheckBox("Italic");
    italic.addActionListener(listener);
    buttonPanel.add(italic);

    add(buttonPanel, BorderLayout.SOUTH);
}

From source file:SerialTransferTest.java

public SerialTransferFrame() {
    setTitle("SerialTransferTest");

    chooser = new JColorChooser();
    add(chooser, BorderLayout.CENTER);
    JPanel panel = new JPanel();

    JButton copyButton = new JButton("Copy");
    panel.add(copyButton);//  w  ww . j av a  2 s. co  m
    copyButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            copy();
        }
    });

    JButton pasteButton = new JButton("Paste");
    panel.add(pasteButton);
    pasteButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            paste();
        }
    });

    add(panel, BorderLayout.SOUTH);
    pack();
}

From source file:com.emental.mindraider.ui.dialogs.FtsJDialog.java

public FtsJDialog() {
    super(Messages.getString("FtsJDialog.title"));

    JPanel dialogPanel = new JPanel();
    dialogPanel.setBorder(new EmptyBorder(5, 10, 0, 10));
    dialogPanel.setLayout(new BorderLayout());

    JPanel contentAndButtons = new JPanel(new GridLayout(2, 1));
    JPanel contentPanel = new JPanel(new BorderLayout());

    // 1a.// w w w  . j  a v  a 2 s. co  m
    // TODO add help like in eclipse
    contentPanel.add(new JLabel(Messages.getString("FtsJDialog.searchString")), BorderLayout.NORTH);
    // 1b.
    String[] knownSearches = new String[] { "", "RDF", "mind", "concept", "China" };
    ftsCombo = new JComboBox(knownSearches);
    ftsCombo.setPreferredSize(new Dimension(200, 18));
    ftsCombo.setEditable(true);
    ftsCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if ("comboBoxEdited".equals(e.getActionCommand())) {
                search();
            }
        }
    });
    contentPanel.add(ftsCombo, BorderLayout.SOUTH);
    contentAndButtons.add(contentPanel);

    // 2.
    JPanel p = new JPanel();
    p.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 5));
    JButton searchButton = new JButton(Messages.getString("FtsJDialog.searchButton"));
    searchButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            search();
        }
    });
    p.add(searchButton);

    JButton cancelButton = new JButton(Messages.getString("FtsJDialog.cancel"));
    cancelButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            dispose();
        }
    });
    p.add(cancelButton);

    contentAndButtons.add(p);

    dialogPanel.add(contentAndButtons, BorderLayout.CENTER);

    getContentPane().add(dialogPanel, BorderLayout.CENTER);

    // show
    pack();
    Gfx.centerAndShowWindow(this);
}

From source file:teambootje.A7.java

/**
 * Creates new form A7/*from   ww w .j  a  v  a  2  s.  c  o  m*/
 */
public A7() {
    initComponents();
    setLocationRelativeTo(null);
    setLayout(new BorderLayout());

    //Create and set up the window.
    setTitle("SS Rotterdam Analyse || Analyse 7");
    ImageIcon icon = new ImageIcon("img/bootje.jpg");
    setIconImage(icon.getImage());

    // back BTN
    JButton back = new JButton("Back");
    add(back, BorderLayout.NORTH);

    back.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            dispose();
            //    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
    });

    // panel en Label
    JPanel ana = new JPanel();
    add(ana, BorderLayout.CENTER);

    //tabel
    String sql = "SELECT doelgroep.doelgroep, COUNT(*) AS Aantal FROM doelgroep GROUP BY doelgroep.doelgroep";
    List<Object[]> list = new ArrayList<Object[]>();
    ResultSet rs = null;
    try {
        rs = db.runSql(sql);
        while (rs.next()) {
            String ta = rs.getString("doelgroep.Doelgroep");
            int amount = rs.getInt("Aantal");
            String[] row = new String[rs.getMetaData().getColumnCount()];
            for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
                row[i - 1] = rs.getString(i);
            }
            list.add(row);

            //chart
            JButton chart = new JButton("Chart");
            add(chart, BorderLayout.SOUTH);

            chart.addActionListener(new ActionListener() {
                String dd = ta;
                int a1 = amount;

                @Override
                public void actionPerformed(ActionEvent e) {

                    DefaultPieDataset pieDataset = new DefaultPieDataset();
                    pieDataset.setValue(dd, a1);
                    pieDataset.setValue("Bedrijfsleven", new Integer(1));
                    pieDataset.setValue("50+", new Integer(1));
                    pieDataset.setValue("40+", new Integer(1));
                    pieDataset.setValue("30+", new Integer(1));
                    JFreeChart chart = ChartFactory.createPieChart3D("Aantal mensen per Doelgroep", pieDataset,
                            true, true, true);
                    PiePlot3D p = (PiePlot3D) chart.getPlot();
                    //p.setForegroundAlpha(TOP_ALIGNMENT);
                    ChartFrame pie = new ChartFrame("Aantal mensen per Doelgroep", chart);
                    pie.setVisible(true);
                    pie.setSize(500, 500);
                    pie.setLocationRelativeTo(null);

                    //    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }
            });
        }
    } catch (SQLException e) {
        JOptionPane.showMessageDialog(null, e);
    }

    Object[][] array = new Object[list.size()][];
    Object columnNames[] = { "Doelgroep", "Aantal" };
    list.toArray(array);

    JTable table = new JTable(array, columnNames);
    JScrollPane scroll = new JScrollPane(table);
    scroll.setPreferredSize(new Dimension(400, 400));
    ana.add(scroll);

}

From source file:TextTransferTest.java

public TextTransferFrame() {
    setTitle("TextTransferTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    textArea = new JTextArea();
    add(new JScrollPane(textArea), BorderLayout.CENTER);
    JPanel panel = new JPanel();

    JButton copyButton = new JButton("Copy");
    panel.add(copyButton);/*from   ww  w  .  ja v a 2 s  .c  o m*/
    copyButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            copy();
        }
    });

    JButton pasteButton = new JButton("Paste");
    panel.add(pasteButton);
    pasteButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            paste();
        }
    });

    add(panel, BorderLayout.SOUTH);
}

From source file:edu.stanford.smi.protegex.owl.ui.widget.HTMLEditorPanel.java

public HTMLEditorPanel(OWLModel owlModel, String text, String language) {
    setLayout(new BorderLayout());
    ekitCore = new EkitCore(null, null, null, null, false, true, true, null, null, false, false);
    ekitCore.setDocumentText(text);/*from   w  w  w.j a v  a2  s.  co  m*/
    JPanel ekitTopPanel = new JPanel();
    ekitTopPanel.setLayout(new GridLayout(2, 1));
    ekitTopPanel.add(ekitCore.getMenuBar());
    ekitTopPanel.add(ekitCore.getToolBar(true));
    if (owlModel != null) {
        languageComboBox = ComponentUtil.createLanguageComboBox(owlModel, language);
        Box languagePanel = Box.createHorizontalBox();
        languagePanel.add(new JLabel("Language: "));
        languagePanel.add(languageComboBox);
        add(BorderLayout.SOUTH, languagePanel);
    }
    add(BorderLayout.NORTH, ekitTopPanel);
    add(BorderLayout.CENTER, ekitCore);
}

From source file:MessageDigestTest.java

public MessageDigestFrame() {
    setTitle("MessageDigestTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    JPanel panel = new JPanel();
    ButtonGroup group = new ButtonGroup();
    addRadioButton(panel, "SHA-1", group);
    addRadioButton(panel, "MD5", group);

    add(panel, BorderLayout.NORTH);
    add(new JScrollPane(message), BorderLayout.CENTER);
    add(digest, BorderLayout.SOUTH);
    digest.setFont(new Font("Monospaced", Font.PLAIN, 12));

    setAlgorithm("SHA-1");

    JMenuBar menuBar = new JMenuBar();
    JMenu menu = new JMenu("File");
    JMenuItem fileDigestItem = new JMenuItem("File digest");
    fileDigestItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            loadFile();/*from w w  w .  ja  va2  s.  co m*/
        }
    });
    menu.add(fileDigestItem);
    JMenuItem textDigestItem = new JMenuItem("Text area digest");
    textDigestItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            String m = message.getText();
            computeDigest(m.getBytes());
        }
    });
    menu.add(textDigestItem);
    menuBar.add(menu);
    setJMenuBar(menuBar);
}