Example usage for javax.swing JPanel JPanel

List of usage examples for javax.swing JPanel JPanel

Introduction

In this page you can find the example usage for javax.swing JPanel JPanel.

Prototype

public JPanel(boolean isDoubleBuffered) 

Source Link

Document

Creates a new JPanel with FlowLayout and the specified buffering strategy.

Usage

From source file:Main.java

public static JComponent scrollV(String title, JComponent content) {
    JPanel p = new JPanel(new BorderLayout());
    p.setBorder(BorderFactory.createTitledBorder(title));
    JScrollPane scroll = new JScrollPane(content);
    scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    p.add(scroll);/*from w w w  .  j  av a2 s .c  o m*/
    return p;
}

From source file:Main.java

public Main() {
    setLayout(new BorderLayout());

    JPanel east = new JPanel(new BorderLayout());
    add(east, BorderLayout.EAST);

    BasicArrowButton north = new BasicArrowButton(BasicArrowButton.NORTH);

    east.add(north, BorderLayout.NORTH);

    BasicArrowButton south = new BasicArrowButton(BasicArrowButton.SOUTH);
    east.add(south, BorderLayout.SOUTH);
}