Example usage for java.awt BorderLayout PAGE_END

List of usage examples for java.awt BorderLayout PAGE_END

Introduction

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

Prototype

String PAGE_END

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

Click Source Link

Document

The component comes after the last line of the layout's content.

Usage

From source file:org.openstatic.irc.client.O5Client.java

public O5Client() {
    super("O5 IRC");
    this.chat_panels = new Hashtable<String, O5ChatPanel>();
    this.server_panels = new Hashtable<String, O5ServerPanel>();
    this.token_id = null;
    this.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(WindowEvent winEvt) {
            System.exit(0);// w ww  .  j  ava 2s . c o  m
        }
    });
    this.tabbed = new JTabbedPane();

    JPanel main_pane = new JPanel();
    main_pane.setLayout(new BorderLayout());
    // Setup tab
    JPanel pane = new JPanel(new GridLayout(0, 2, 6, 6));
    pane.setSize(50, 100);

    JLabel server_label = new JLabel("Server:", JLabel.TRAILING);
    server_field = new JTextField(15);
    server_field.setText("127.0.0.1:4050");

    JLabel username_label = new JLabel("Username:", JLabel.TRAILING);
    username_field = new JTextField(15);

    JLabel password_label = new JLabel("Password:", JLabel.TRAILING);
    password_field = new JTextField(15);

    login_btn = new JButton("Connect");
    login_btn.setActionCommand("login");
    login_btn.addActionListener(this);

    pane.add(server_label);
    pane.add(server_field);

    pane.add(username_label);
    pane.add(username_field);

    pane.add(password_label);
    pane.add(password_field);

    pane.add(new JLabel(""));
    pane.add(login_btn);

    JPanel page_start = new JPanel(new BorderLayout());

    JLabel page_header = new JLabel("O5 Client");
    page_header.setFont(new Font("Monospaced", Font.BOLD, 36));

    page_start.add(page_header, BorderLayout.PAGE_START);
    page_start.add(pane, BorderLayout.PAGE_END);

    main_pane.add(page_start, BorderLayout.PAGE_START);

    tabbed.addTab("Connect", null, main_pane, "");

    // finish window
    this.add(tabbed);
    centerWindow();
    this.setVisible(true);
}

From source file:Panels.FinanzPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*from   ww  w  . j av a  2s . c  o m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jButton1 = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();

    setLayout(new java.awt.BorderLayout());

    jButton1.setText("jButton1");
    add(jButton1, java.awt.BorderLayout.PAGE_END);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 400, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 277, Short.MAX_VALUE));

    add(jPanel1, java.awt.BorderLayout.CENTER);
}

From source file:components.TextComponentDemo.java

public TextComponentDemo() {
    super("TextComponentDemo");

    //Create the text pane and configure it.
    textPane = new JTextPane();
    textPane.setCaretPosition(0);/*from   ww  w  .j  av a2s  . c o m*/
    textPane.setMargin(new Insets(5, 5, 5, 5));
    StyledDocument styledDoc = textPane.getStyledDocument();
    if (styledDoc instanceof AbstractDocument) {
        doc = (AbstractDocument) styledDoc;
        doc.setDocumentFilter(new DocumentSizeFilter(MAX_CHARACTERS));
    } else {
        System.err.println("Text pane's document isn't an AbstractDocument!");
        System.exit(-1);
    }
    JScrollPane scrollPane = new JScrollPane(textPane);
    scrollPane.setPreferredSize(new Dimension(200, 200));

    //Create the text area for the status log and configure it.
    changeLog = new JTextArea(5, 30);
    changeLog.setEditable(false);
    JScrollPane scrollPaneForLog = new JScrollPane(changeLog);

    //Create a split pane for the change log and the text area.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog);
    splitPane.setOneTouchExpandable(true);

    //Create the status area.
    JPanel statusPane = new JPanel(new GridLayout(1, 1));
    CaretListenerLabel caretListenerLabel = new CaretListenerLabel("Caret Status");
    statusPane.add(caretListenerLabel);

    //Add the components.
    getContentPane().add(splitPane, BorderLayout.CENTER);
    getContentPane().add(statusPane, BorderLayout.PAGE_END);

    //Set up the menu bar.
    actions = createActionTable(textPane);
    JMenu editMenu = createEditMenu();
    JMenu styleMenu = createStyleMenu();
    JMenuBar mb = new JMenuBar();
    mb.add(editMenu);
    mb.add(styleMenu);
    setJMenuBar(mb);

    //Add some key bindings.
    addBindings();

    //Put the initial text into the text pane.
    initDocument();
    textPane.setCaretPosition(0);

    //Start watching for undoable edits and caret changes.
    doc.addUndoableEditListener(new MyUndoableEditListener());
    textPane.addCaretListener(caretListenerLabel);
    doc.addDocumentListener(new MyDocumentListener());
}

From source file:streaming.swing.JPanelListeSeries.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*from   ww  w . ja va2s  . c o m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jToolBar1 = new javax.swing.JToolBar();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jtSerie = new javax.swing.JTable();
    jButton3 = new javax.swing.JButton();

    setLayout(new java.awt.BorderLayout());

    jToolBar1.setRollover(true);

    jButton1.setText("Ajouter une srie");
    jButton1.setFocusable(false);
    jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton1);

    jButton2.setText("Supprimer une Srie");
    jButton2.setFocusable(false);
    jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton2);

    add(jToolBar1, java.awt.BorderLayout.PAGE_START);

    jtSerie.setModel(
            new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jScrollPane1.setViewportView(jtSerie);

    add(jScrollPane1, java.awt.BorderLayout.CENTER);

    jButton3.setText("Accder aux saisons");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });
    add(jButton3, java.awt.BorderLayout.PAGE_END);
}

From source file:components.DialogDemo.java

/** Creates the GUI shown inside the frame's content pane. */
public DialogDemo(JFrame frame) {
    super(new BorderLayout());
    this.frame = frame;
    customDialog = new CustomDialog(frame, "geisel", this);
    customDialog.pack();/*from w  ww . ja  va  2 s . com*/

    //Create the components.
    JPanel frequentPanel = createSimpleDialogBox();
    JPanel featurePanel = createFeatureDialogBox();
    JPanel iconPanel = createIconDialogBox();
    label = new JLabel("Click the \"Show it!\" button" + " to bring up the selected dialog.", JLabel.CENTER);

    //Lay them out.
    Border padding = BorderFactory.createEmptyBorder(20, 20, 5, 20);
    frequentPanel.setBorder(padding);
    featurePanel.setBorder(padding);
    iconPanel.setBorder(padding);

    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Simple Modal Dialogs", null, frequentPanel, simpleDialogDesc); //tooltip text
    tabbedPane.addTab("More Dialogs", null, featurePanel, moreDialogDesc); //tooltip text
    tabbedPane.addTab("Dialog Icons", null, iconPanel, iconDesc); //tooltip text

    add(tabbedPane, BorderLayout.CENTER);
    add(label, BorderLayout.PAGE_END);
    label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
}

From source file:com.frostwire.gui.components.slides.MultimediaSlideshowPanel.java

private void setup(List<Slide> slides) {
    this.slides = filter(slides);

    GUIMediator.safeInvokeLater(new Runnable() {
        public void run() {
            List<Slide> slides = MultimediaSlideshowPanel.this.slides;
            try {
                int i = 0;
                for (Slide s : slides) {
                    add(new SlidePanel(s, i), String.valueOf(i));
                    i++;/*from w w  w.  ja  v a  2 s  .c o  m*/
                }

                if (container != null && useControls) {
                    container.add(new SlideshowPanelControls(MultimediaSlideshowPanel.this),
                            BorderLayout.PAGE_END);
                }

                if (slides != null && !slides.isEmpty()) {
                    timer = new Timer("SlideShow Timer");
                    timer.schedule(new SlideSwitcher(), slides.get(0).duration);
                }
            } catch (Exception e) {
                LOG.error(e.getMessage(), e);
            }
        }
    });
}

From source file:integratedprogressdemo.WeatherData.java

private WeatherData(boolean displayProgress) {
    setBackground(Color.WHITE);/*from   ww  w  .ja  va2s. co m*/
    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:com.jdom.util.patterns.mvp.swing.RadioButtonGroupDialog.java

private RadioButtonGroupDialog(Frame frame, Component locationComp, String labelText, String title,
        Collection<String> data, String initialValue, String longValue) {
    super(frame, title, true);

    final JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(this);

    final JButton setButton = new JButton("OK");
    setButton.setActionCommand("OK");
    setButton.addActionListener(this);
    getRootPane().setDefaultButton(setButton);

    ButtonGroup radioButtonGroup = new ButtonGroup();
    for (String option : data) {
        JRadioButton button = new JRadioButton(option);
        if (option.equals(initialValue)) {
            button.setSelected(true);//from ww  w  .  j a v  a  2s .  c  om
        }
        radioButtonGroup.add(button);
        panel.add(button);
    }

    JScrollPane listScroller = new JScrollPane(panel);
    listScroller.setPreferredSize(new Dimension(250, 80));
    listScroller.setAlignmentX(LEFT_ALIGNMENT);

    JPanel listPane = new JPanel();
    listPane.setLayout(new BoxLayout(listPane, BoxLayout.PAGE_AXIS));

    if (!StringUtils.isEmpty(labelText)) {
        JLabel label = new JLabel(labelText);
        label.setText(labelText);
        listPane.add(label);
    }
    listPane.add(Box.createRigidArea(new Dimension(0, 5)));
    listPane.add(listScroller);
    listPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
    buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
    buttonPane.add(Box.createHorizontalGlue());
    buttonPane.add(cancelButton);
    buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonPane.add(setButton);

    Container contentPane = getContentPane();
    contentPane.add(listPane, BorderLayout.CENTER);
    contentPane.add(buttonPane, BorderLayout.PAGE_END);

    pack();
    setLocationRelativeTo(locationComp);
}

From source file:DragFileDemo.java

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

    fc = new JFileChooser();
    ;//  ww  w .  j  a v a  2s.c  o m
    fc.setMultiSelectionEnabled(true);
    fc.setDragEnabled(true);
    fc.setControlButtonsAreShown(false);
    JPanel fcPanel = new JPanel(new BorderLayout());
    fcPanel.add(fc, BorderLayout.CENTER);

    clear = new JButton("Clear All");
    clear.addActionListener(this);
    JPanel buttonPanel = new JPanel(new BorderLayout());
    buttonPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    buttonPanel.add(clear, BorderLayout.LINE_END);

    JPanel upperPanel = new JPanel(new BorderLayout());
    upperPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    upperPanel.add(fcPanel, BorderLayout.CENTER);
    upperPanel.add(buttonPanel, BorderLayout.PAGE_END);

    //The TabbedPaneController manages the panel that
    //contains the tabbed pane. When there are no files
    //the panel contains a plain text area. Then, as
    //files are dropped onto the area, the tabbed panel
    //replaces the file area.
    JTabbedPane tabbedPane = new JTabbedPane();
    JPanel tabPanel = new JPanel(new BorderLayout());
    tabPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    tpc = new TabbedPaneController(tabbedPane, tabPanel);

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upperPanel, tabPanel);
    splitPane.setDividerLocation(400);
    splitPane.setPreferredSize(new Dimension(530, 650));
    add(splitPane, BorderLayout.CENTER);
}

From source file:DragColorDemo.java

public DragColorDemo() {
    super(new BorderLayout());
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

    JColorChooser chooser = new JColorChooser();
    chooser.setDragEnabled(true);/*  ww  w .  j  a  va  2s.c  om*/
    add(chooser, BorderLayout.PAGE_START);

    //Create the color transfer handler.
    colorHandler = new ColorTransferHandler();

    //Create a matrix of 9 buttons.
    JPanel buttonPanel = new JPanel(new GridLayout(3, 3));
    for (int i = 0; i < 9; i++) {
        JButton tmp = new JButton("Button " + i);
        tmp.setTransferHandler(colorHandler);
        buttonPanel.add(tmp);
    }
    add(buttonPanel, BorderLayout.CENTER);

    //Create a check box.
    toggleForeground = new JCheckBox("Change the foreground color.");
    toggleForeground.setSelected(true);
    toggleForeground.addActionListener(this);
    JPanel textPanel = new JPanel(new BorderLayout());
    textPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    textPanel.add(toggleForeground, BorderLayout.PAGE_START);

    //Create a label.
    JLabel label = new JLabel("Change the color of any button or this label by dropping a color.");
    label.setTransferHandler(colorHandler);
    label.setOpaque(true); //So the background color can be changed.
    textPanel.add(label, BorderLayout.PAGE_END);
    add(textPanel, BorderLayout.PAGE_END);
}