/** * Standard constructor - creates a three button panel with the specified button labels. * * @param label1 the label for button 1. * @param label2 the label for button 2. * @param label3 the label for button 3. */ public L1R2ButtonPanel(final String label1, final String label2, final String label3) { setLayout(new BorderLayout()); // create the pieces... this.left = new JButton(label1); final JPanel rightButtonPanel = new JPanel(new GridLayout(1, 2)); this.right1 = new JButton(label2); this.right2 = new JButton(label3); rightButtonPanel.add(this.right1); rightButtonPanel.add(this.right2); // ...and put them together add(this.left, BorderLayout.WEST); add(rightButtonPanel, BorderLayout.EAST); }
/** * Standard constructor - creates a three button panel with the specified button labels. * * @param label1 the label for button 1. * @param label2 the label for button 2. * @param label3 the label for button 3. */ public L1R2ButtonPanel(final String label1, final String label2, final String label3) { setLayout(new BorderLayout()); // create the pieces... this.left = new JButton(label1); final JPanel rightButtonPanel = new JPanel(new GridLayout(1, 2)); this.right1 = new JButton(label2); this.right2 = new JButton(label3); rightButtonPanel.add(this.right1); rightButtonPanel.add(this.right2); // ...and put them together add(this.left, BorderLayout.WEST); add(rightButtonPanel, BorderLayout.EAST); }
/** * Standard constructor - creates a three button panel with the specified button labels. * * @param label1 the label for button 1. * @param label2 the label for button 2. * @param label3 the label for button 3. */ public L1R2ButtonPanel(final String label1, final String label2, final String label3) { setLayout(new BorderLayout()); // create the pieces... this.left = new JButton(label1); final JPanel rightButtonPanel = new JPanel(new GridLayout(1, 2)); this.right1 = new JButton(label2); this.right2 = new JButton(label3); rightButtonPanel.add(this.right1); rightButtonPanel.add(this.right2); // ...and put them together add(this.left, BorderLayout.WEST); add(rightButtonPanel, BorderLayout.EAST); }