Java 8 BorderLayout - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 BorderLayout class.

This code example shows how to use the following methods:
public class Slider extends JPanel {
	public JSpinner spinner;
 
	public Slider (float initialValue, final float min, final float max, float stepSize) {
		spinner = new JSpinner(new SpinnerNumberModel(initialValue, min, max, stepSize));
		setLayout(new BorderLayout());
		add(spinner);
	} 
 
	public void setValue (float value) {
		spinner.setValue((double)value);
	} 
 
	public float getValue () { 
		return ((Double)spinner.getValue()).floatValue();
	} 
 
	public void addChangeListener (ChangeListener listener) {
		spinner.addChangeListener(listener);
	} 
8
CodeRank
This code example shows how to use the following methods:
	private JSpinner spinner;
 
	public Slider (float initialValue, final float min, final float max, float stepSize, final float sliderMin,
		final float sliderMax) {
		spinner = new JSpinner(new SpinnerNumberModel(initialValue, min, max, stepSize));
		setLayout(new BorderLayout());
		add(spinner);
	} 
 
	public void setValue (float value) {
		spinner.setValue((double)value);
	} 
 
	public float getValue () { 
		return ((Double)spinner.getValue()).floatValue();
	} 
 
	public void addChangeListener (ChangeListener listener) {
		spinner.addChangeListener(listener);
	} 
8
CodeRank
This code example shows how to use the following methods:
    } 
 
    private void initializeComponent() { 
        JPanel panel = new JPanel();
        panel.setLayout(new GridBagLayout());
        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
 
        processIdTextField = new JTextField("com.sample.ruleflow");
        GridBagConstraints c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(processIdTextField, c);
 
        startButton = new JButton("Start");
        startButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                start(); 
            } 
7
CodeRank
This code example shows how to use the following methods:sleep
        glCanvas.setSize(preferredGLSize);
 
        glCanvas.addGLEventListener(new GearsES2());
 
        final Window window = new JFrame(this.getSimpleTestName(" - "));
        window.setLayout(new BorderLayout());
        window.add(glCanvas, BorderLayout.CENTER);
 
        // trigger realization on AWT-EDT, otherwise it won't immediatly .. 
        SwingUtilities.invokeAndWait(new Runnable() {
            @Override 
            public void run() { 
                window.pack();
                window.validate();
                window.setVisible(true);
            } 
        } ); 
 
        // Immediately displayable after issuing initial setVisible(true) on AWT-EDT! 
        Assert.assertTrue("GLCanvas didn't become displayable", glCanvas.isDisplayable());

7
CodeRank
This code example shows how to use the following methods:
	} 
 
	public void init() { 
		System.out.println("*** init ***");
 
		setLayout(new BorderLayout());
		try { 
			test = (Test) Class.forName(getParameter("test")).newInstance();
			Canvas canvas = (Canvas) test;
			canvas.setSize(getWidth(), getHeight());
			add(canvas);
		} catch (Exception e) {
			e.printStackTrace();
		} 
		test.start();
	} 
} 
8
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:sleep
        c.add(new Button("south"), BorderLayout.SOUTH);
        c.add(new Button("east"), BorderLayout.EAST);
        c.add(new Button("west"), BorderLayout.WEST);
        c.add(comp, BorderLayout.CENTER);
 
        f.setLayout(new BorderLayout());
        f.add(new Button("NORTH"), BorderLayout.NORTH);
        f.add(new Button("SOUTH"), BorderLayout.SOUTH);
        f.add(new Button("EAST"), BorderLayout.EAST);
        f.add(new Button("WEST"), BorderLayout.WEST);
        f.add(c, BorderLayout.CENTER);
 
        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
            public void run() { 
                f.pack();
                f.validate();
                f.setVisible(true);
            }}); 
    } 
 

7
CodeRank
This code example shows how to use the following methods:
    list2.setTransferHandler(arrayListHandler);
    list2.setDragEnabled(true);
    JScrollPane list2View = new JScrollPane(list2);
    list2View.setPreferredSize(new Dimension(200, 100));
    JPanel panel2 = new JPanel();
    panel2.setLayout(new BorderLayout());
    panel2.add(list2View, BorderLayout.CENTER);
    panel2.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
 
    setLayout(new BorderLayout());
    add(panel1, BorderLayout.LINE_START);
    add(panel2, BorderLayout.LINE_END);
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
  } 
 
  /** 
   * Create the GUI and show it. For thread safety, this method should be 
   * invoked from the event-dispatching thread. 
   */ 
  public static JFrame createAndShowGUI() {
8
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
public class BrowseBar extends JPanel {
	 
	private static final long serialVersionUID = -5745389338067538254L;
	 
	public BrowseBar(Navigator navigator, ContentPane chapterPane) {
		super(new BorderLayout());
		add(new ButtonBar(navigator, chapterPane), BorderLayout.CENTER);
		add(new SpineSlider(navigator), BorderLayout.NORTH);
	} 
} 
7
CodeRank
See Code Examples for Java 8 BorderLayout Methods: