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:QandE.SwingApp1.java

void createGUI(JFrame f) {
    startButton = new JButton("Start");
    stopButton = new JButton("Stop");
    label = new JLabel("Press Start.", JLabel.CENTER);

    Container c = f.getContentPane();
    //Use the content pane's default BorderLayout layout manager.
    c.add(startButton, BorderLayout.WEST);
    c.add(stopButton, BorderLayout.EAST);
    c.add(label, BorderLayout.SOUTH);
}

From source file:SliderControlPaintLine.java

public SliderControlPaintLine() {
    JPanel controlPanel = new JPanel();
    controlPanel.setLayout(new GridLayout(3, 3));
    getContentPane().add(controlPanel, BorderLayout.NORTH);

    JLabel label1 = new JLabel("Translate(dx,dy): ");
    JLabel label2 = new JLabel("Rotate(Theta,ox,oy): ");
    JLabel label3 = new JLabel("Scale(sx,sy)x10E-2:");

    controlPanel.add(label1);//w w w.ja v  a  2  s. c o m

    slider1 = createSlider(controlPanel, JSlider.HORIZONTAL, 0, 300, 150, 100, 50);
    slider2 = createSlider(controlPanel, JSlider.HORIZONTAL, 0, 300, 150, 100, 50);

    controlPanel.add(label2);

    slider3 = createSlider(controlPanel, JSlider.HORIZONTAL, 0, 360, 0, 90, 45);

    JPanel subPanel = new JPanel();
    subPanel.setLayout(new GridLayout(1, 2));

    slider4 = createSlider(subPanel, JSlider.HORIZONTAL, 0, 300, 150, 150, 50);
    slider5 = createSlider(subPanel, JSlider.HORIZONTAL, 0, 300, 150, 150, 50);
    controlPanel.add(subPanel);

    controlPanel.add(label3);

    slider6 = createSlider(controlPanel, JSlider.HORIZONTAL, 0, 200, 100, 100, 10);
    slider7 = createSlider(controlPanel, JSlider.HORIZONTAL, 0, 200, 100, 100, 10);

    JPanel widthPanel = new JPanel();
    JLabel label4 = new JLabel("Width Control:", JLabel.RIGHT);
    slider8 = createSlider(widthPanel, JSlider.HORIZONTAL, 0, 200, 100, 100, 10);
    slider8.addChangeListener(new SliderListener());

    widthPanel.setLayout(new GridLayout(1, 2));
    widthPanel.add(label4);
    widthPanel.add(slider8);
    getContentPane().add(widthPanel, BorderLayout.SOUTH);

    getContentPane().add(canvas);

    setSize(500, 500);
    setVisible(true);
}

From source file:com.joey.software.memoryToolkit.MemoryUsagePanel.java

public static JFrame getMemoryUsagePanel(int dataNum, int delay) {
    final MemoryUsagePanel u = new MemoryUsagePanel(dataNum, delay);
    JFrame f = new JFrame("Memory Usage");
    f.setLayout(new BorderLayout());
    f.getContentPane().add(u, BorderLayout.CENTER);
    f.setSize(800, 400);/*from   w ww  . jav a  2 s  . c o  m*/
    f.setVisible(true);

    final JButton runButton = new JButton("Start");
    runButton.addActionListener(new ActionListener() {

        boolean running = false;

        @Override
        public void actionPerformed(ActionEvent e) {
            if (running) {
                running = false;
                u.stopUpdating();
                runButton.setText("Start");
            } else {
                running = true;
                u.startUpdating();
                runButton.setText("Stop");
            }
        }
    });

    JButton garbage = new JButton("Run GC");
    garbage.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            System.gc();
        }
    });

    JPanel temp = new JPanel(new GridLayout(1, 1));

    temp.add(runButton);
    temp.add(garbage);

    f.getContentPane().add(temp, BorderLayout.SOUTH);

    return f;
}

From source file:de.fhg.igd.iva.explorer.main.CompareViewPanel.java

public CompareViewPanel(Table<KnownColormap, ColormapQuality, Double> info) {
    this.table = info;

    setBorder(new EmptyBorder(5, 5, 5, 5));
    setLayout(new BorderLayout());

    JPanel statsPanel = new JPanel(new BorderLayout());

    //      statsLabel = new JLabel();
    //      statsLabel.setBorder(BorderFactory.createTitledBorder("Statistics"));
    //      statsPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    statsBars = new JPanel(new GridBagLayout());
    statsPanel.add(statsBars, BorderLayout.NORTH);
    //      statsPanel.add(statsLabel, BorderLayout.SOUTH);
    add(statsPanel, BorderLayout.SOUTH);

    cmView = new ColormapPanel(new ConstantColormap(), 256);
    cmView.setBorder(new EmptyBorder(5, 0, 5, 0));
    add(cmView, BorderLayout.CENTER);

    mapsCombo = new JComboBox<KnownColormap>(table.rowKeySet().toArray(new KnownColormap[0]));
    mapsCombo.addActionListener(new ActionListener() {
        @Override/*ww w . j av a  2s. c  o  m*/
        public void actionPerformed(ActionEvent e) {
            updateSelection();
        }

    });
    mapsCombo.setSelectedIndex(0);

    add(mapsCombo, BorderLayout.NORTH);
}

From source file:Bounce.java

/**
 * Constructs the frame with the component for showing the bouncing ball and
 * Start and Close buttons/*  w ww  .j av a  2s.c o  m*/
 */
public BounceFrame() {
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
    setTitle("Bounce");

    comp = new BallComponent();
    add(comp, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel();
    addButton(buttonPanel, "Start", new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            addBall();
        }
    });

    addButton(buttonPanel, "Close", new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            System.exit(0);
        }
    });
    add(buttonPanel, BorderLayout.SOUTH);
}

From source file:AlphaCompositeDemo.java

public AlphaCompositeDemo() {
    super();// ww w .j av  a2  s.  co m
    Container container = getContentPane();

    canvas = new MyCanvas();
    container.add(canvas);

    rulesBox = new JComboBox(rulesLabels);
    rulesBox.setSelectedIndex(0);
    rulesBox.setAlignmentX(Component.LEFT_ALIGNMENT);
    rulesBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JComboBox cb = (JComboBox) e.getSource();
            canvas.compositeRule = rules[cb.getSelectedIndex()];
            canvas.repaint();
        }
    });

    slider.setPaintTicks(true);
    slider.setMajorTickSpacing(25);
    slider.setMinorTickSpacing(25);
    slider.setPaintLabels(true);
    slider.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            JSlider slider = (JSlider) e.getSource();
            canvas.alphaValue = (float) slider.getValue() / 100;
            canvas.repaint();
        }
    });

    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(1, 3));
    panel.add(rulesBox);
    panel.add(new JLabel("Alpha Adjustment x E-2: ", JLabel.RIGHT));
    panel.add(slider);
    container.add(panel, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    setSize(500, 300);
    setVisible(true);
}

From source file:SwingWorkerTest.java

public SwingWorkerFrame() {
    chooser = new JFileChooser();
    chooser.setCurrentDirectory(new File("."));

    textArea = new JTextArea();
    add(new JScrollPane(textArea));
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    statusLine = new JLabel(" ");
    add(statusLine, BorderLayout.SOUTH);

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);/*from  w w  w . j  av  a2 s. c o  m*/

    JMenu menu = new JMenu("File");
    menuBar.add(menu);

    openItem = new JMenuItem("Open");
    menu.add(openItem);
    openItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            // show file chooser dialog
            int result = chooser.showOpenDialog(null);

            // if file selected, set it as icon of the label
            if (result == JFileChooser.APPROVE_OPTION) {
                textArea.setText("");
                openItem.setEnabled(false);
                textReader = new TextReader(chooser.getSelectedFile());
                textReader.execute();
                cancelItem.setEnabled(true);
            }
        }
    });

    cancelItem = new JMenuItem("Cancel");
    menu.add(cancelItem);
    cancelItem.setEnabled(false);
    cancelItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            textReader.cancel(true);
        }
    });
}

From source file:org.encog.workbench.tabs.weights.AnalyzeWeightsTab.java

public AnalyzeWeightsTab(EncogPersistedObject encogObject) {
    super(encogObject);

    this.network = (BasicNetwork) encogObject;
    this.analyze = new AnalyzeNetwork(this.network);

    this.setLayout(new BorderLayout());

    JPanel buttonPanel = new JPanel();
    add(buttonPanel, BorderLayout.SOUTH);

    this.buttonClose = new JButton("Close");
    buttonPanel.add(this.buttonClose);
    this.buttonClose.addActionListener(this);

    this.weightInfo = new WeightInfo(this);
    this.add(this.weightInfo, BorderLayout.NORTH);

    ////from ww w  .  j  av a 2  s.  c o  m
    createAllDataset();
    ChartPanel allChart = new ChartPanel(createChart(this.dataAll));
    ChartPanel weightChart = new ChartPanel(createChart(this.dataWeights));
    ChartPanel thresholdChart = new ChartPanel(createChart(this.dataThresholds));

    this.tabs = new JTabbedPane();
    this.add(tabs, BorderLayout.CENTER);
    this.tabs.addTab("Weights & Thresholds", allChart);
    this.tabs.addTab("Thresholds", weightChart);
    this.tabs.addTab("Weights", thresholdChart);

}

From source file:brainflow.core.ImageBrowser.java

private void initSourceView() {
    sourceView = new JList();
    final DefaultListModel model = new DefaultListModel();
    for (IImageSource source : sourceList.sourceList) {
        model.addElement(source);/*from   ww  w  .j a  v a 2 s . c  om*/
    }

    sourceView.setModel(model);
    sourceView.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    ButtonPanel panel = new ButtonPanel(SwingConstants.CENTER);

    JButton nextButton = new JButton("Next");
    ImageIcon icon = new ImageIcon(getClass().getClassLoader().getResource("icons/control_play_blue.png"));
    nextButton.setIcon(icon);

    JButton prevButton = new JButton("Previous");
    icon = new ImageIcon(getClass().getClassLoader().getResource("icons/control_rev_blue.png"));
    prevButton.setIcon(icon);
    panel.addButton(prevButton);
    panel.addButton(nextButton);
    panel.setSizeConstraint(ButtonPanel.SAME_SIZE);

    JPanel container = new JPanel(new BorderLayout());
    container.setBorder(new TitledBorder("Image List"));
    container.add(new JScrollPane(sourceView), BorderLayout.CENTER);
    container.add(panel, BorderLayout.SOUTH);
    add(container, BorderLayout.WEST);

    nextButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int index = sourceView.getSelectedIndex();
            if (index == (sourceList.size() - 1)) {
                index = 0;
            } else {
                index++;
            }

            updateView(index);

        }
    });

    sourceView.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            int index = sourceView.getSelectedIndex();
            if (currentModel.getSelectedLayer().getDataSource() != sourceView.getSelectedValue()) {
                System.out.println("updating view");
                updateView(index);
            } else {
                System.out.println("not updating view ");
            }

        }
    });
}

From source file:com.univocity.app.swing.DataAnalysisWindow.java

public DataAnalysisWindow(DataIntegrationConfig config) {
    setLookAndFeel();//w w w .  jav a 2  s  .c  om

    this.config = config;
    this.setTitle("uniVocity data integration: " + config.getSourceDatabaseConfig().getDatabaseName() + " -> "
            + config.getDestinationDatabaseConfig().getDatabaseName());
    this.setGlassPane(getGlass());
    this.setIconImage(getIcon());
    setDefaultCloseOperation(EXIT_ON_CLOSE);

    Container container = getContentPane();
    container.setLayout(new BorderLayout());

    JPanel northPanel = new JPanel(new BorderLayout());
    northPanel.add(getProcessPanel(), BorderLayout.CENTER);
    northPanel.add(getLogoPanel(), BorderLayout.NORTH);

    container.add(northPanel, BorderLayout.NORTH);
    container.add(getDataAnalysisPanel(), BorderLayout.CENTER);
    container.add(getStatusPanel(), BorderLayout.SOUTH);

    setSize(Toolkit.getDefaultToolkit().getScreenSize());
    setLocationRelativeTo(null);
}