List of usage examples for java.awt BorderLayout SOUTH
String SOUTH
To view the source code for java.awt BorderLayout SOUTH.
Click Source Link
From source file:Main.java
public Main() { setLayout(new BorderLayout()); setSize(300, 300);// ww w . ja va2 s .com setVisible(true); JPanel p = new JPanel(new FlowLayout()); p.add(b); p.add(b1); add(p, BorderLayout.SOUTH); b.addActionListener(this); b1.addActionListener(this); m = new ImageIcon[2]; m[0] = new ImageIcon("m.jpg"); m[1] = new ImageIcon("m1.jpg"); l = new JLabel(); l.setBounds(400, 0, getWidth(), getHeight()); add(l, BorderLayout.CENTER); l.setIcon(m[0]); }
From source file:Main.java
public Main() { setLayout(new BorderLayout()); JScrollBar hbar = new JScrollBar(JScrollBar.HORIZONTAL, 30, 20, 0, 300); JScrollBar vbar = new JScrollBar(JScrollBar.VERTICAL, 30, 40, 0, 300); hbar.setUnitIncrement(2);//www .j av a 2s . c om hbar.setBlockIncrement(1); hbar.addAdjustmentListener(new MyAdjustmentListener()); vbar.addAdjustmentListener(new MyAdjustmentListener()); add(hbar, BorderLayout.SOUTH); add(vbar, BorderLayout.EAST); add(label, BorderLayout.CENTER); }
From source file:Main.java
public Main() { jPanel1.setLayout(new GridLayout(0, 2, 10, 10)); jButton1.addActionListener(e -> { JCheckBox cb = new JCheckBox("New CheckBox"); jPanel1.add(cb);// w ww .j av a 2 s .c om jPanel1.revalidate(); jPanel1.repaint(); }); frame.add(jScrollPane1); frame.add(jButton1, BorderLayout.SOUTH); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 200); frame.setVisible(true); }
From source file:Main.java
public void createUI() { JPanel borderPanel = new JPanel(new BorderLayout()); JLabel northLabel = new JLabel("Nawth"); borderPanel.add(northLabel, BorderLayout.NORTH); JComboBox southCombo = new JComboBox(); borderPanel.add(southCombo, BorderLayout.SOUTH); JPanel centerPanel = new JPanel(); centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.PAGE_AXIS)); JComboBox firstCombo = new JComboBox(); centerPanel.add(firstCombo);//from w w w .ja v a 2 s . co m centerPanel.add(Box.createVerticalGlue()); JPanel centerPanelConstrain = new JPanel(new GridBagLayout()); centerPanelConstrain.add(centerPanel); borderPanel.add(centerPanelConstrain, BorderLayout.CENTER); getContentPane().add(borderPanel); pack(); }
From source file:Main.java
public Main() { this.setUndecorated(true); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setSize(200, 200); Ellipse2D.Double ellipse = new Ellipse2D.Double(0, 0, 200, 100); Rectangle2D.Double rect = new Rectangle2D.Double(0, 100, 200, 200); Path2D path = new Path2D.Double(); path.append(rect, true);//w ww . j a va 2s.co m path.append(ellipse, true); this.setShape(path); JButton closeButton = new JButton("Close"); this.add(closeButton, BorderLayout.SOUTH); closeButton.addActionListener(e -> System.exit(0)); }
From source file:Main.java
public Main() { Vector model = new Vector(); model.addElement(new Item(new ImageIcon("copy16.gif"), "copy")); model.addElement(new Item(new ImageIcon("add16.gif"), "add")); model.addElement(new Item(new ImageIcon("about16.gif"), "about")); JComboBox comboBox;//from www . j a v a 2 s . c o m comboBox = new JComboBox(model); comboBox.setRenderer(new ItemRenderer()); getContentPane().add(comboBox, BorderLayout.SOUTH); }
From source file:Main.java
public Main() { textArea.setText("This is just a line of text"); textArea.setFont(newFont);//from ww w .ja va2 s .c o m button.addActionListener(e -> { textArea.setFont(textArea.getFont().deriveFont(20f)); frame.pack(); }); scrollPane.setViewportView(textArea); frame.add(scrollPane); frame.add(button, BorderLayout.SOUTH); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocation(100, 100); frame.pack(); frame.setVisible(true); }
From source file:MainClass.java
public MainClass() { super(true);/*from w w w.j a v a 2 s . c om*/ setLayout(new BorderLayout()); JScrollBar hbar = new JScrollBar(JScrollBar.HORIZONTAL, 30, 20, 0, 300); JScrollBar vbar = new JScrollBar(JScrollBar.VERTICAL, 30, 40, 0, 300); hbar.setUnitIncrement(2); hbar.setBlockIncrement(1); hbar.addAdjustmentListener(new MyAdjustmentListener()); vbar.addAdjustmentListener(new MyAdjustmentListener()); add(hbar, BorderLayout.SOUTH); add(vbar, BorderLayout.EAST); add(label, BorderLayout.CENTER); }
From source file:Box1.java
public void init() { Box bv = Box.createVerticalBox(); for (int i = 0; i < 5; i++) bv.add(new JButton("bv " + i)); Box bh = Box.createHorizontalBox(); for (int i = 0; i < 5; i++) bh.add(new JButton("bh " + i)); Container cp = getContentPane(); cp.add(BorderLayout.EAST, bv); cp.add(BorderLayout.SOUTH, bh); }
From source file:Main.java
public Main() { Vector model = new Vector(); model.addElement(new Item(1, "A")); model.addElement(new Item(2, "B")); model.addElement(new Item(4, "C")); model.addElement(new Item(3, "D")); JComboBox comboBox = new JComboBox(model); comboBox.setRenderer(new ItemRenderer()); comboBox.addActionListener(this); getContentPane().add(comboBox, BorderLayout.SOUTH); }