Example usage for java.awt BorderLayout PAGE_START

List of usage examples for java.awt BorderLayout PAGE_START

Introduction

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

Prototype

String PAGE_START

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

Click Source Link

Document

The component comes before the first line of the layout's content.

Usage

From source file:org.zaproxy.zap.extension.browserView.ResponseBrowserView.java

public ResponseBrowserView(HttpPanelViewModel model) {
    this.model = model;
    ssb = new BrowserPanel(false);
    mainPanel = new JPanel(new BorderLayout());

    JToolBar toolBar = createToolbar();
    mainPanel.add(toolBar, BorderLayout.PAGE_START);

    mainPanel.add(new JScrollPane(ssb), BorderLayout.CENTER);
    this.model.addHttpPanelViewModelListener(this);
}

From source file:GetApplets.java

private void createGUI() {
    JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.BLACK),
            BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    setContentPane(contentPane);//from w w  w  . jav  a 2  s.c  o m

    JButton b = new JButton("Click to call getApplets()");
    b.addActionListener(this);
    add(b, BorderLayout.PAGE_START);

    textArea = new JTextArea(5, 40);
    textArea.setEditable(false);
    JScrollPane scroller = new JScrollPane(textArea);
    add(scroller, BorderLayout.CENTER);
}

From source file:components.FileChooserDemo2.java

public FileChooserDemo2() {
    super(new BorderLayout());

    //Create the log first, because the action listener
    //needs to refer to it.
    log = new JTextArea(5, 20);
    log.setMargin(new Insets(5, 5, 5, 5));
    log.setEditable(false);/* w  ww  . j  a v  a  2 s. c om*/
    JScrollPane logScrollPane = new JScrollPane(log);

    JButton sendButton = new JButton("Attach...");
    sendButton.addActionListener(this);

    add(sendButton, BorderLayout.PAGE_START);
    add(logScrollPane, BorderLayout.CENTER);
}

From source file:layout.CardLayoutDemo.java

public void addComponentToPane(Container pane) {
    //Put the JComboBox in a JPanel to get a nicer look.
    JPanel comboBoxPane = new JPanel(); //use FlowLayout
    String comboBoxItems[] = { BUTTONPANEL, TEXTPANEL };
    JComboBox cb = new JComboBox(comboBoxItems);
    cb.setEditable(false);// w ww .  j  a  v a2  s.  c  om
    cb.addItemListener(this);
    comboBoxPane.add(cb);

    //Create the "cards".
    JPanel card1 = new JPanel();
    card1.add(new JButton("Button 1"));
    card1.add(new JButton("Button 2"));
    card1.add(new JButton("Button 3"));

    JPanel card2 = new JPanel();
    card2.add(new JTextField("TextField", 20));

    //Create the panel that contains the "cards".
    cards = new JPanel(new CardLayout());
    cards.add(card1, BUTTONPANEL);
    cards.add(card2, TEXTPANEL);

    pane.add(comboBoxPane, BorderLayout.PAGE_START);
    pane.add(cards, BorderLayout.CENTER);
}

From source file:integratedprogressdemo.WeatherData.java

private WeatherData(boolean displayProgress) {
    setBackground(Color.WHITE);//from w w w.  j ava  2  s.  c om
    setLayout(new BorderLayout());
    JLabel lbl = new JLabel("World-Wide Weather Data");
    lbl.setFont(new Font("Serif", Font.PLAIN, 18));

    add(lbl, BorderLayout.PAGE_START);
    lbl = new JLabel("Weather information from over 50 cities");
    add(lbl, BorderLayout.LINE_START);

    if (displayProgress) {
        progressPanel = new JPanel();
        progressPanel.setBackground(Color.WHITE);
        progressPanel.setLayout(new BorderLayout(20, 20));

        String lblText = "<html>Stuck in the mud? Make progress with...<br /><font color=red><em>JDK Documentation</em></font><br/></html>";
        lbl = new JLabel(lblText);
        progressPanel.add(lbl, BorderLayout.NORTH);

        progressBar = new JProgressBar(0, 100);
        progressBar.setValue(0);
        progressBar.setStringPainted(true);
        progressPanel.add(progressBar, BorderLayout.SOUTH);

        add(progressPanel, BorderLayout.LINE_END);
    }

    String[] columnNames = { "City", "Temperature" };
    JTable table = new JTable(getData(), columnNames);

    table.setPreferredScrollableViewportSize(new Dimension(500, 70));
    table.setFillsViewportHeight(true);

    //Create the scroll pane and add the table to it.
    JScrollPane scrollPane = new JScrollPane(table);
    scrollPane.setBackground(Color.WHITE);

    //Add the scroll pane to this panel.
    add(scrollPane, BorderLayout.PAGE_END);
}

From source file:Main.java

public Main() {
    super(new BorderLayout());
    task = new LongTask();

    //Create the demo's UI.
    startButton = new JButton("Start");
    startButton.setActionCommand("start");
    startButton.addActionListener(this);

    taskOutput = new JTextArea(5, 20);
    taskOutput.setMargin(new Insets(5, 5, 5, 5));
    taskOutput.setEditable(false);// w w  w.j av a2  s  . co m

    add(startButton, BorderLayout.PAGE_START);
    add(new JScrollPane(taskOutput), BorderLayout.CENTER);
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

    //Create a timer.
    timer = new Timer(ONE_SECOND, new TimerListener());
}

From source file:ProgressMonitorDemo.java

public ProgressMonitorDemo() {
    super(new BorderLayout());
    task = new LongTask();

    //Create the demo's UI.
    startButton = new JButton("Start");
    startButton.setActionCommand("start");
    startButton.addActionListener(this);

    taskOutput = new JTextArea(5, 20);
    taskOutput.setMargin(new Insets(5, 5, 5, 5));
    taskOutput.setEditable(false);/*from w w  w.  j av a  2  s  . c om*/

    add(startButton, BorderLayout.PAGE_START);
    add(new JScrollPane(taskOutput), BorderLayout.CENTER);
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

    //Create a timer.
    timer = new Timer(ONE_SECOND, new TimerListener());
}

From source file:components.ToolBarDemo.java

public ToolBarDemo() {
    super(new BorderLayout());

    //Create the toolbar.
    JToolBar toolBar = new JToolBar("Still draggable");
    addButtons(toolBar);/*from www. jav a 2s  .c  om*/

    //Create the text area used for output.  Request
    //enough space for 5 rows and 30 columns.
    textArea = new JTextArea(5, 30);
    textArea.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(textArea);

    //Lay out the main panel.
    setPreferredSize(new Dimension(450, 130));
    add(toolBar, BorderLayout.PAGE_START);
    add(scrollPane, BorderLayout.CENTER);
}

From source file:onetimepad.frame.java

public frame() {
    //create a layout
    JFrame app = new JFrame("secure chat");
    fc = new JFileChooser();
    app.setLayout(new BorderLayout());
    log = new JTextArea(15, 30);
    log.setMargin(new Insets(5, 5, 5, 5));
    log.setEditable(false);/*from   w ww . ja  v  a2  s  .  com*/
    JScrollPane logScrollPane = new JScrollPane(log);
    //Create the open button
    newchat = new JButton("Start new chat");
    newchat.addActionListener(this);

    //Create the save button.
    loadchat = new JButton("Load key");
    loadchat.addActionListener(this);

    sendmessage = new JButton("send");
    sendmessage.addActionListener(this);

    start = new JButton("start");
    start.addActionListener(this);

    JPanel buttonPanel = new JPanel();
    buttonPanel.add(newchat);
    buttonPanel.add(loadchat);
    buttonPanel.add(sendmessage);
    buttonPanel.add(start);

    JPanel you = new JPanel();
    JTextArea me = new JTextArea("Username: ");
    me.setEnabled(false);
    name = new JTextArea();
    name.setColumns(20);
    you.add(me);
    you.add(name);

    JPanel rec = new JPanel();
    JTextArea to = new JTextArea("To: ");
    to.setEnabled(false);
    user = new JTextArea();
    user.setColumns(20);
    rec.add(to);
    rec.add(user);

    JPanel deelnemers = new JPanel();
    deelnemers.setLayout(new BorderLayout());
    deelnemers.add(you, BorderLayout.PAGE_START);
    deelnemers.add(rec, BorderLayout.CENTER);

    JPanel top = new JPanel();
    top.setLayout(new BorderLayout());
    top.add(buttonPanel, BorderLayout.PAGE_START);
    top.add(deelnemers, BorderLayout.CENTER);

    JPanel send = new JPanel();
    send.setLayout(new BorderLayout());
    JTextArea label = new JTextArea("Message: ");
    label.setEnabled(false);
    message = new JTextArea();
    message.setColumns(30);
    message.setRows(3);

    send.add(label, BorderLayout.PAGE_START);
    send.add(message, BorderLayout.CENTER);

    super.add(top, BorderLayout.PAGE_START);
    super.add(send, BorderLayout.CENTER);
    super.add(logScrollPane, BorderLayout.SOUTH);
}

From source file:misc.FocusTraversalDemo.java

public FocusTraversalDemo() {
    super(new BorderLayout());

    JTextField tf1 = new JTextField("Field 1");
    JTextField tf2 = new JTextField("A Bigger Field 2");
    JTextField tf3 = new JTextField("Field 3");
    JTextField tf4 = new JTextField("A Bigger Field 4");
    JTextField tf5 = new JTextField("Field 5");
    JTextField tf6 = new JTextField("A Bigger Field 6");
    JTable table = new JTable(4, 3);
    togglePolicy = new JCheckBox("Custom FocusTraversalPolicy");
    togglePolicy.setActionCommand("toggle");
    togglePolicy.addActionListener(this);
    togglePolicy.setFocusable(false); //Remove it from the focus cycle.
    //Note that HTML is allowed and will break this run of text
    //across two lines.
    label = new JLabel(
            "<html>Use Tab (or Shift-Tab) to navigate from component to component.<p>Control-Tab (or Control-Shift-Tab) allows you to break out of the JTable.</html>");

    JPanel leftTextPanel = new JPanel(new GridLayout(3, 2));
    leftTextPanel.add(tf1, BorderLayout.PAGE_START);
    leftTextPanel.add(tf3, BorderLayout.CENTER);
    leftTextPanel.add(tf5, BorderLayout.PAGE_END);
    leftTextPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 5));
    JPanel rightTextPanel = new JPanel(new GridLayout(3, 2));
    rightTextPanel.add(tf2, BorderLayout.PAGE_START);
    rightTextPanel.add(tf4, BorderLayout.CENTER);
    rightTextPanel.add(tf6, BorderLayout.PAGE_END);
    rightTextPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 5));
    JPanel tablePanel = new JPanel(new GridLayout(0, 1));
    tablePanel.add(table, BorderLayout.CENTER);
    tablePanel.setBorder(BorderFactory.createEtchedBorder());
    JPanel bottomPanel = new JPanel(new GridLayout(2, 1));
    bottomPanel.add(togglePolicy, BorderLayout.PAGE_START);
    bottomPanel.add(label, BorderLayout.PAGE_END);

    add(leftTextPanel, BorderLayout.LINE_START);
    add(rightTextPanel, BorderLayout.CENTER);
    add(tablePanel, BorderLayout.LINE_END);
    add(bottomPanel, BorderLayout.PAGE_END);
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    Vector<Component> order = new Vector<Component>(7);
    order.add(tf1);/*  w  w  w.  j a v a  2s.c  o  m*/
    order.add(tf2);
    order.add(tf3);
    order.add(tf4);
    order.add(tf5);
    order.add(tf6);
    order.add(table);
    newPolicy = new MyOwnFocusTraversalPolicy(order);
}