/** * Builds and returns the user interface for the dialog. This method is shared among the * constructors. * * @return the button panel. */ protected JPanel createButtonPanel() { final L1R2ButtonPanel buttons = new L1R2ButtonPanel(localizationResources.getString("Help"), localizationResources.getString("OK"), localizationResources.getString("Cancel")); final JButton helpButton = buttons.getLeftButton(); helpButton.setActionCommand("helpButton"); helpButton.addActionListener(this); final JButton okButton = buttons.getRightButton1(); okButton.setActionCommand("okButton"); okButton.addActionListener(this); final JButton cancelButton = buttons.getRightButton2(); cancelButton.setActionCommand("cancelButton"); cancelButton.addActionListener(this); buttons.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); return buttons; }
/** * 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); }
/** * Builds and returns the user interface for the dialog. This method is * shared among the constructors. * * @return the button panel. */ protected JPanel createButtonPanel() { final L1R2ButtonPanel buttons = new L1R2ButtonPanel( localizationResources.getString("Help"), localizationResources.getString("OK"), localizationResources.getString("Cancel")); final JButton helpButton = buttons.getLeftButton(); helpButton.setActionCommand("helpButton"); helpButton.addActionListener(this); final JButton okButton = buttons.getRightButton1(); okButton.setActionCommand("okButton"); okButton.addActionListener(this); final JButton cancelButton = buttons.getRightButton2(); cancelButton.setActionCommand("cancelButton"); cancelButton.addActionListener(this); buttons.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); return buttons; }
/** * 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); }
/** * Builds and returns the user interface for the dialog. This method is * shared among the constructors. * * @return the button panel. */ protected JPanel createButtonPanel() { final L1R2ButtonPanel buttons = new L1R2ButtonPanel( localizationResources.getString("Help"), localizationResources.getString("OK"), localizationResources.getString("Cancel")); final JButton helpButton = buttons.getLeftButton(); helpButton.setActionCommand("helpButton"); helpButton.addActionListener(this); final JButton okButton = buttons.getRightButton1(); okButton.setActionCommand("okButton"); okButton.addActionListener(this); final JButton cancelButton = buttons.getRightButton2(); cancelButton.setActionCommand("cancelButton"); cancelButton.addActionListener(this); buttons.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); return buttons; }