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:Main.java

public DriveTree(File dir) {
    setLayout(new BorderLayout());
    JTree tree = new JTree(addNodes(null, dir));
    add(tree);
}

From source file:MonthPanel.java

public MonthPanel(int month, int year) {
    this.month = month;
    this.year = year;
    JPanel monthPanel = new JPanel(true);
    monthPanel.setLayout(new BorderLayout());
    monthPanel.add(createTitleGUI(), BorderLayout.NORTH);
    monthPanel.add(createDaysGUI(), BorderLayout.SOUTH);
    this.add(monthPanel);
}

From source file:com.js.quickestquail.ui.stats.GenreStat.java

public GenreStat() {
    setLayout(new BorderLayout());
    add(new ChartPanel(generateChart()), BorderLayout.CENTER);
}

From source file:com.js.quickestquail.ui.stats.LanguageStat.java

public LanguageStat() {
    setLayout(new BorderLayout());
    add(new ChartPanel(generateChart()), BorderLayout.CENTER);
}

From source file:Main.java

public Main() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    textField1.requestFocusInWindow();//from   w w w. j ava  2  s .  c o  m
    tab1.add(textField1);

    tab2.add(textField2);
    tab2.add(textField3);

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

    tabbedPane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT);
    tabbedPane.addTab("TAB 1", null, tab1, "I am TAB 1");
    tabbedPane.addTab("TAB 2", null, tab2, "I am TAB 2");

    focusButton = new JButton("CHANGE FOCUS");
    getRootPane().setDefaultButton(focusButton);
    focusButton.addActionListener(this);

    contentPane.add(tabbedPane, BorderLayout.CENTER);
    contentPane.add(focusButton, BorderLayout.PAGE_END);
    setContentPane(contentPane);
    pack();
    setVisible(true);
}

From source file:com.js.quickestquail.ui.stats.CountryStat.java

public CountryStat() {
    setLayout(new BorderLayout());
    add(new ChartPanel(generateChart()), BorderLayout.CENTER);
}

From source file:SelectionMonitor.java

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

    list = new JList(label);
    JScrollPane pane = new JScrollPane(list);

    //  Format the list and the buttons in a vertical box
    Box rightBox = new Box(BoxLayout.Y_AXIS);
    Box leftBox = new Box(BoxLayout.Y_AXIS);

    //  Monitor all list selections
    list.addListSelectionListener(new RadioUpdater());

    for (int i = 0; i < label.length; i++) {
        checks[i] = new JCheckBox("Selection " + i);
        checks[i].setEnabled(false);/*from  w  ww  .  jav  a 2  s  . co m*/
        rightBox.add(checks[i]);
    }
    leftBox.add(pane);
    add(rightBox, BorderLayout.EAST);
    add(leftBox, BorderLayout.WEST);
}

From source file:ShapeMover.java

public void init() {

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(new MyCanvas());

    getContentPane().add("South", label);
}

From source file:Main.java

public ShadowPane() {
    setLayout(new BorderLayout());
    setOpaque(false);
    setBackground(Color.BLACK);
    setBorder(new EmptyBorder(0, 0, 10, 10));
}

From source file:JDK6SplashTest.java

public JDK6SplashTest() {
    super("SplashScreen demo");
    setSize(500, 300);//from  www  .  ja  v a 2s. c  om
    setLayout(new BorderLayout());
    Menu m1 = new Menu("File");
    MenuItem mi1 = new MenuItem("Exit");
    m1.add(mi1);
    mi1.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            System.exit(0);
        }

    });

    MenuBar mb = new MenuBar();
    setMenuBar(mb);
    mb.add(m1);
    final SplashScreen splash = SplashScreen.getSplashScreen();
    if (splash == null) {
        System.out.println("SplashScreen.getSplashScreen() returned null");
        return;
    }
    Graphics2D g = (Graphics2D) splash.createGraphics();
    if (g == null) {
        System.out.println("g is null");
        return;
    }
    for (int i = 0; i < 100; i++) {
        renderSplashFrame(g, i);
        splash.update();
        try {
            Thread.sleep(200);
        } catch (InterruptedException e) {
        }
    }
    splash.close();
    setVisible(true);
    toFront();
}