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:teambootje.A6.java

/**
 * Creates new form A6/*from   w w  w  .  j  ava2 s .c  om*/
 */
public A6() {
    initComponents();
    setLocationRelativeTo(null);
    setLayout(new BorderLayout());

    //Create and set up the window.
    setTitle("SS Rotterdam Analyse || Analyse 6");
    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 Locatie.land, locatie.stad, count(persoon.LID) as Aantal FROM persoon, Locatie WHERE persoon.LID = locatie.LID GROUP BY stad";
    List<Object[]> list = new ArrayList<Object[]>();
    ResultSet rs = null;
    try {
        rs = db.runSql(sql);
        while (rs.next()) {
            String city = rs.getString("locatie.stad");
            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 c1 = city;
                int a1 = amount;

                @Override
                public void actionPerformed(ActionEvent e) {
                    DefaultPieDataset pieDataset = new DefaultPieDataset();
                    pieDataset.setValue(c1, a1);
                    pieDataset.setValue("Rotterdam", new Integer(1));
                    pieDataset.setValue("Bergen op zoom", new Integer(1));

                    JFreeChart chart = ChartFactory.createPieChart3D("Waar komen bezoekers vandaan", pieDataset,
                            true, true, true);
                    PiePlot3D p = (PiePlot3D) chart.getPlot();
                    //p.setForegroundAlpha(TOP_ALIGNMENT);
                    ChartFrame pie = new ChartFrame("Waar komen bezoekers vandaan", 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[] = { "Land", "stad", "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:org.encog.workbench.tabs.visualize.weights.AnalyzeWeightsTab.java

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

    if (!(encogObject.getObject() instanceof BasicNetwork)) {
        throw new WorkBenchError(
                "Can't visualize weights of " + encogObject.getObject().getClass().getSimpleName());
    }/*from   w ww  .  j a va 2  s .  c  om*/

    this.network = (BasicNetwork) encogObject.getObject();
    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);

    //
    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:arduinoserialread.SerialRead.java

private void initGUI() {

    // init the frame
    frame.setTitle("Arduino Serial Read");
    frame.setBounds(100, 100, 600, 500);
    frame.setMinimumSize(new Dimension(600, 500));
    frame.setLocationRelativeTo(null);// w w w .j  a va 2s . c o m
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // init control panel
    JPanel ctrlPanel = new JPanel();
    ctrlPanel.setLayout(new FlowLayout());

    // init the serial connection panel
    serialCOM = new SerialConnectionPanel();
    ctrlPanel.add(serialCOM);
    frame.getContentPane().add(ctrlPanel, BorderLayout.SOUTH);

    // init the connection status
    ConnectionStatus connectionStatus = new ConnectionStatus();
    ctrlPanel.add(connectionStatus);

    // init connect and disconnect button
    connect = new JButton("connect");
    ctrlPanel.add(connect);
    disconnect = new JButton("disconnect");
    ctrlPanel.add(disconnect);

    // init real time chart
    TimeSeries series = new TimeSeries("DATA");
    DateAxis timeAxis = new DateAxis("Time");
    dataset = new TimeSeriesCollection(series);
    NumberAxis rangeAxis = new NumberAxis("Data");
    rangeAxis.setAutoRangeIncludesZero(false);
    rangeAxis.setAutoRange(true);
    XYPlot plot = new XYPlot(dataset, timeAxis, rangeAxis, new StandardXYItemRenderer());
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.getRenderer().setSeriesPaint(0, new Color(0, 142, 192));
    ValueAxis domainAxis = plot.getDomainAxis();
    domainAxis.setAutoRange(true);
    domainAxis.setFixedAutoRange(30000.0); // 30 seconds
    // init the JFreeChart
    JFreeChart chart = new JFreeChart("Real-Time Data Chart", plot);
    chart.setBorderPaint(Color.lightGray);
    chart.setBorderVisible(true);
    chart.setBackgroundPaint(Color.white);
    chart.removeLegend();
    // add real time chart to the frame
    ChartPanel chartPanel = new ChartPanel(chart);
    frame.getContentPane().add(chartPanel, BorderLayout.CENTER);

}

From source file:teambootje.A8.java

/**
 * Creates new form A8/* w ww  .ja va 2  s.  c  o m*/
 */
public A8() {
    initComponents();
    setLocationRelativeTo(null);
    setLayout(new BorderLayout());

    //Create and set up the window.
    setTitle("SS Rotterdam Analyse || Analyse 8");
    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(posts.post) AS Aantal FROM doelgroep, posts WHERE posts.DID = doelgroep.DID 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("50+", new Integer(0));
                    pieDataset.setValue("Tiener", new Integer(0));
                    pieDataset.setValue("40+", new Integer(0));
                    pieDataset.setValue("30+", new Integer(0));
                    JFreeChart chart = ChartFactory.createPieChart3D("Aantal Posts per doelgroep", pieDataset,
                            true, true, true);
                    PiePlot3D p = (PiePlot3D) chart.getPlot();
                    //p.setForegroundAlpha(TOP_ALIGNMENT);
                    ChartFrame pie = new ChartFrame("Aantal Posts 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[] = { "Doelgoep", "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:org.jdal.swing.ViewFrame.java

public void init() {
    acceptAction.setView(view);//from   w  ww.ja v  a  2s . c o  m
    cancelAction.setView(view);
    acceptAction.setDialog(this);
    cancelAction.setDialog(this);
    add(view.getPanel(), BorderLayout.CENTER);
    add(createButtonBox(), BorderLayout.SOUTH);

    if (view.getModel() != null && StringUtils.isEmpty(getTitle()))
        setTitle(view.getModel().toString());

    setLocationRelativeTo(null);
    setSize(new Dimension(windowWidth, windowHeight));
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    addWindowListener(new CloseListener());
}

From source file:org.pmedv.jake.app.PlayerView.java

public PlayerView() {
    super(new BorderLayout());
    fileTable = new AlternatingLineTable();
    fileTable.setColumnControlVisible(true);
    fileTable.setTableHeader(null);/*from ww  w .jav a  2  s .c  o  m*/
    filterPanel = new FilterPanel();
    filterPanel.setBackground(Colors.SOFT_BLUE_ICE);
    filterPanel.getFilterTextField().setBackground(Colors.LIGHT_GRAY);
    JScrollPane scrollPane = new JScrollPane(fileTable);
    add(scrollPane, BorderLayout.CENTER);
    add(filterPanel, BorderLayout.SOUTH);
    add(createTopPanel(), BorderLayout.NORTH);
}

From source file:net.chaosserver.timelord.swingui.JCalendarDialog.java

/**
 * Creates the dialog./*from w  w  w .  ja v a  2 s  . c  o m*/
 *
 * @param owner the owner frame
 * @param selectedDate the date to have the calendar on, or null for
 *        current date.
 */
public JCalendarDialog(Frame owner, Date selectedDate) {
    super(owner, "Pick Date", true);
    calendar = new JCalendar();

    if (selectedDate != null) {
        calendar.setDate(selectedDate);
    }

    this.getContentPane().setLayout(new BorderLayout());
    this.getContentPane().add(calendar, BorderLayout.NORTH);

    JPanel buttonPanel = new JPanel();
    JButton selectButton = new JButton("Select");
    selectButton.setActionCommand(actionSelect);
    selectButton.addActionListener(this);
    buttonPanel.add(selectButton);

    JButton cancelButton = new JButton("Cancel");
    cancelButton.setActionCommand(actionCancel);
    cancelButton.addActionListener(this);
    buttonPanel.add(cancelButton);

    this.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
}

From source file:House.java

public House() {
    super(new BorderLayout());
    JPanel controlPanel = new JPanel(new GridLayout(3, 3));
    add(controlPanel, BorderLayout.NORTH);

    controlPanel.add(new JLabel("Translate(dx,dy): "));

    sliderTransX = setSlider(controlPanel, JSlider.HORIZONTAL, 0, 300, 150, 100, 50);
    sliderTransY = setSlider(controlPanel, JSlider.HORIZONTAL, 0, 300, 150, 100, 50);

    // To control rotation
    controlPanel.add(new JLabel("Rotate(Theta,ox,oy): "));
    sliderRotateTheta = setSlider(controlPanel, JSlider.HORIZONTAL, 0, 360, 0, 90, 45);

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

    sliderRotateX = setSlider(subPanel, JSlider.HORIZONTAL, 0, 300, 150, 150, 50);

    sliderRotateY = setSlider(subPanel, JSlider.HORIZONTAL, 0, 300, 150, 150, 50);
    controlPanel.add(subPanel);//  w w  w .j a v a2 s  . co m

    // To control scaling
    controlPanel.add(new JLabel("Scale(sx,sy)x10E-2:"));

    sliderScaleX = setSlider(controlPanel, JSlider.HORIZONTAL, 0, 200, 100, 100, 10);

    sliderScaleY = setSlider(controlPanel, JSlider.HORIZONTAL, 0, 200, 100, 100, 10);

    // To control width of line segments
    JLabel label4 = new JLabel("Width Control:", JLabel.RIGHT);
    sliderWidth = new JSlider(JSlider.HORIZONTAL, 0, 20, 1);
    sliderWidth.setPaintTicks(true);
    sliderWidth.setMajorTickSpacing(5);
    sliderWidth.setMinorTickSpacing(1);
    sliderWidth.setPaintLabels(true);
    sliderWidth.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            width = sliderWidth.getValue();
            canvas.repaint();
        }
    });
    JPanel widthPanel = new JPanel();
    widthPanel.setLayout(new GridLayout(1, 2));
    widthPanel.add(label4);
    widthPanel.add(sliderWidth);
    add(widthPanel, BorderLayout.SOUTH);

    canvas = new MyCanvas();
    add(canvas, "Center");
}

From source file:Main.java

public ProgressBarFrame() {
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    // this text area holds the activity output
    textArea = new JTextArea();

    // set up panel with button and progress bar

    final int MAX = 1000;
    JPanel panel = new JPanel();
    startButton = new JButton("Start");
    progressBar = new JProgressBar(0, MAX);
    progressBar.setStringPainted(true);/*from   ww  w  .j  a v  a  2 s  .  c o  m*/
    panel.add(startButton);
    panel.add(progressBar);

    checkBox = new JCheckBox("indeterminate");
    checkBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            progressBar.setIndeterminate(checkBox.isSelected());
            progressBar.setStringPainted(!progressBar.isIndeterminate());
        }
    });
    panel.add(checkBox);
    add(new JScrollPane(textArea), BorderLayout.CENTER);
    add(panel, BorderLayout.SOUTH);

    // set up the button action

    startButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            startButton.setEnabled(false);
            activity = new SimulatedActivity(MAX);
            activity.execute();
        }
    });
}

From source file:ch.zhaw.ias.dito.ui.util.SingleHistogramPanel.java

public SingleHistogramPanel(Matrix m) {
    super(new BorderLayout());
    this.m = m;//ww w. j  av  a2  s  .  c  o m
    this.chart = createChart();
    this.chartPanel = new ChartPanel(this.chart);

    Border border = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4),
            BorderFactory.createEtchedBorder());
    this.chartPanel.setBorder(border);
    add(this.chartPanel, BorderLayout.CENTER);

    JPanel dashboard = new JPanel(new BorderLayout());
    dashboard.setBorder(BorderFactory.createEmptyBorder(0, 4, 4, 4));

    this.spinner = new JSpinner(new SpinnerNumberModel(0, 0, m.getColCount() - 1, 1));
    spinner.addChangeListener(this);
    this.slider = new JSlider(0, m.getColCount() - 1, 0);
    slider.setPaintLabels(true);

    slider.setMajorTickSpacing(Math.max(50, 10 * Math.round(m.getColCount() / 100)));
    slider.setPaintTicks(true);
    this.slider.addChangeListener(this);

    FormLayout layout = new FormLayout("fill:0:g, max(20dlu; pref)", "top:pref");
    CellConstraints cc = new CellConstraints();
    DefaultFormBuilder fb = new DefaultFormBuilder(layout, Translation.INSTANCE.getBundle());

    fb.add(slider, cc.xy(1, 1));
    fb.add(spinner, cc.xy(2, 1));

    dashboard.add(fb.getPanel(), BorderLayout.CENTER);
    add(dashboard, BorderLayout.SOUTH);
    switchColumn(0);
}