Example usage for java.awt BorderLayout BorderLayout

List of usage examples for java.awt BorderLayout BorderLayout

Introduction

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

Prototype

public BorderLayout() 

Source Link

Document

Constructs a new border layout with no gaps between components.

Usage

From source file:AppletMenuBarDemo.java

public void init() {
    AppletMenuBar menubar = new AppletMenuBar();
    menubar.setForeground(Color.black);
    menubar.setHighlightColor(Color.red);
    menubar.setFont(new Font("helvetica", Font.BOLD, 12));
    this.setLayout(new BorderLayout());
    this.add(menubar, BorderLayout.NORTH);

    PopupMenu file = new PopupMenu();
    file.add("New...");
    file.add("Open...");
    file.add("Save As...");
    PopupMenu edit = new PopupMenu();
    edit.add("Cut");
    edit.add("Copy");
    edit.add("Paste");

    menubar.addMenu("File", file);
    menubar.addMenu("Edit", edit);
}

From source file:com.jtk.pengelolaanujian.view.dashboard.PiePanelUjian.java

public void preparation() {
    terlalui = 0;//from   www  .  j av  a  2 s  . c  o m
    belum = 0;
    triggerDashboardController = new TriggerDashboardController();
    panel = createChart(createData());
    panel.setPreferredSize(new Dimension(250, 250));

    setLayout(new BorderLayout());
    add(panel, BorderLayout.CENTER);
}

From source file:com.jtk.pengelolaanujian.view.dashboard.PiePanelSoal.java

public void preparation() {
    uploaded = 0;//  w  ww.  j  ava 2s  .  com
    unuploaded = 0;
    triggerDashboardController = new TriggerDashboardController();
    panel = createChart(createData(triggerDashboardController));
    panel.setPreferredSize(new Dimension(250, 250));

    setLayout(new BorderLayout());
    add(panel, BorderLayout.CENTER);

}

From source file:Main.java

public Main() {
    setLayout(new BorderLayout());
    JButton button = new JButton("Print");
    button.addActionListener(new PrintListener());

    booklist = new JList(books);
    booklist.setCellRenderer(new BookCellRenderer());
    booklist.setVisibleRowCount(4);// w w  w  . j a  va  2s .c o  m
    JScrollPane pane = new JScrollPane(booklist);

    add(pane, BorderLayout.NORTH);
    add(button, BorderLayout.SOUTH);
}

From source file:de.rbs90.fwdisp.settingsgui.gui.tabs.statistics.YearStatisticPanel.java

public YearStatisticPanel() {
    setName("Jahr");
    setLayout(new BorderLayout());

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    HashMap<Integer, Integer> alarmCount = new HashMap<>();

    try {//from  ww  w. j  a  v a2s  .  c om
        ResultSet resultSet = Starter.getDatabase().getStatement().executeQuery(
                "SELECT STARTDATE_YEAR, COUNT(*) AS COUNT FROM ALARMHISTORY GROUP BY STARTDATE_YEAR"
                        + " ORDER BY STARTDATE_YEAR ASC");

        while (resultSet.next()) {
            alarmCount.put(resultSet.getInt("STARTDATE_YEAR"), resultSet.getInt("COUNT"));
        }

    } catch (SQLException e) {
        e.printStackTrace();
    }

    Set<Integer> years = alarmCount.keySet();

    for (Integer year : years) {
        Integer count = alarmCount.get(year);
        dataset.addValue(count, count, year);
    }

    JFreeChart chart = ChartFactory.createBarChart3D("Jahresbersicht", "Jahr", "Einstze", dataset,
            PlotOrientation.VERTICAL, false, false, false);

    chart.setBackgroundPaint(getBackground());
    ChartPanel panel = new ChartPanel(chart);
    panel.setPopupMenu(null);

    add(panel, BorderLayout.CENTER);
}

From source file:de.rbs90.fwdisp.settingsgui.gui.tabs.statistics.MonthlyStatisticPanel.java

public MonthlyStatisticPanel() {
    setName("Monat");
    setLayout(new BorderLayout());

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    int alarmCount[] = new int[12];

    try {//from w  w  w .  j  a va 2  s .  c o m
        ResultSet resultSet = Starter.getDatabase().getStatement().executeQuery(
                "SELECT STARTDATE_MONTH, COUNT(*) AS COUNT FROM ALARMHISTORY GROUP BY STARTDATE_MONTH");

        while (resultSet.next()) {
            alarmCount[resultSet.getInt("STARTDATE_MONTH") - 1] = resultSet.getInt("COUNT");
        }

    } catch (SQLException e) {
        e.printStackTrace();
    }

    for (int i = 0; i < 12; i++) {
        dataset.addValue(alarmCount[i], "", "" + (i + 1));
    }

    JFreeChart chart = ChartFactory.createBarChart3D("Monatsbersicht", "Monat", "Einstze", dataset,
            PlotOrientation.VERTICAL, false, false, false);

    chart.setBackgroundPaint(getBackground());
    ChartPanel panel = new ChartPanel(chart);
    panel.setPopupMenu(null);

    add(panel, BorderLayout.CENTER);
}

From source file:SwingListExample.java

public SwingListExample() {
    setLayout(new BorderLayout());
    JButton button = new JButton("Print");
    button.addActionListener(new PrintListener());

    booklist = new JList(books);
    booklist.setCellRenderer(new BookCellRenderer());
    booklist.setVisibleRowCount(4);//from  w  w w .ja  va  2  s  . c  o m
    JScrollPane pane = new JScrollPane(booklist);

    add(pane, BorderLayout.NORTH);
    add(button, BorderLayout.SOUTH);
}

From source file:ec.ui.chart.ChartPopup.java

public ChartPopup(Frame owner, boolean modal) {
    super(owner, modal);
    setLayout(new BorderLayout());

    setType(Type.UTILITY);/*  w  w  w.  j a v a 2s  .  c  om*/
    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

    addWindowFocusListener(new WindowFocusListener() {
        @Override
        public void windowLostFocus(java.awt.event.WindowEvent evt) {
            dispose();
        }

        @Override
        public void windowGainedFocus(WindowEvent e) {
        }
    });

    panel = new RevisionChartPanel(createChart());

    add(panel, BorderLayout.CENTER);
    setPreferredSize(new Dimension(350, 200));
    setSize(new Dimension(350, 200));
}

From source file:visualize.GraphFrame.java

public GraphFrame(final JFreeChart chart) {
    super();/*from www  .  jav a 2s. co m*/

    mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());

    updateWithNewChart(chart, true);

    JPanel buttonsPanel = new JPanel();
    mainPanel.add(buttonsPanel, BorderLayout.SOUTH);

    setContentPane(mainPanel);
    validate();
    GUI.center(this);
}

From source file:lu.lippmann.cdb.datasetview.tabs.ScatterPlotTabView.java

/**
 * Constructor.//  ww w  . j a  v a  2 s. c o  m
 */
public ScatterPlotTabView() {
    super();

    this.panel = new JXPanel();
    this.panel.setLayout(new BorderLayout());
}