Available Methods
- addActionListener ( )
- setToolTipText ( )
- setActionCommand ( )
- setEnabled ( )
- setIcon ( )
- setPreferredSize ( )
- setText ( )
- setMnemonic ( )
- setMargin ( )
- setBorder ( )
- setFont ( )
- setFocusable ( )
- setOpaque ( )
- setBounds ( )
- setFocusPainted ( )
- setBorderPainted ( )
- setBackground ( )
- setForeground ( )
- setContentAreaFilled ( )
- setHorizontalTextPosition ( )
- doClick ( )
- setVisible ( )
- putClientProperty ( )
- setName ( )
- setMinimumSize ( )
- setMaximumSize ( )
- setRolloverIcon ( )
- addMouseListener ( )
- setAlignmentX ( )
- setHorizontalAlignment ( )
- setCursor ( )
- setAction ( )
- requestFocus ( )
- setDefaultCapable ( )
- setUI ( )
- setRequestFocusEnabled ( )
- getVerticalAlignment ( )
- setPressedIcon ( )
- isEnabled ( )
- getText ( )
- getPreferredSize ( )
- setVerticalAlignment ( )
- setRolloverEnabled ( )
- hasFocus ( )
- getClientProperty ( )
- setAlignmentY ( )
- getFont ( )
- isVisible ( )
- setVerticalTextPosition ( )
- getIcon ( )
- setAutoscrolls ( )
- imageUpdate ( )
- setSelected ( )
- getToolTipText ( )
- setSize ( )
- removeActionListener ( )
- repaint ( )
- addFocusListener ( )
- equals ( )
- getRolloverIcon ( )
- setDisabledIcon ( )
- setLayout ( )
- requestFocusInWindow ( )
Related Classes
- java.io.File
- java.awt.Color
- java.awt.event.ActionEvent
- java.awt.event.ActionListener
- javax.swing.JPanel
- java.awt.Dimension
- javax.swing.JFrame
- java.awt.Font
- java.awt.event.MouseEvent
- javax.swing.JLabel
- java.awt.event.KeyEvent
- java.awt.BorderLayout
- javax.swing.JOptionPane
- java.awt.Component
- javax.swing.JScrollPane
- java.awt.event.WindowEvent
- javax.swing.JTextField
- javax.swing.SwingUtilities
- java.awt.event.MouseAdapter
- javax.swing.ImageIcon
- javax.swing.JFileChooser
- javax.swing.JComponent
- java.awt.event.WindowAdapter
- javax.swing.JCheckBox
- javax.swing.UIManager
Java Code Examples for javax.swing.JButton#setLayout()
The following examples show how to use
javax.swing.JButton#setLayout() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NewUnitPanel.java From freecol with GNU General Public License v2.0 | 5 votes |
/** * {@inheritDoc} */ @Override public void removeNotify() { super.removeNotify(); removeAll(); for (JButton jb : buttons) { if (jb != null) jb.setLayout(null); } buttons.clear(); }
Example 2
Source File: NewUnitPanel.java From freecol with GNU General Public License v2.0 | 4 votes |
/** * Updates this panel's labels so that the information it displays * is up to date. */ public void update() { removeAll(); final Player player = getMyPlayer(); final Europe europe = player.getEurope(); add(question, "span, wrap 20"); // The prices may have changed, recreate the buttons buttons.clear(); for (UnitType ut : sort(units, priceComparator)) { int price = europe.getUnitPrice(ut); boolean enable = player.checkGold(price); JButton newButton = new JButton(); newButton.setLayout(new MigLayout("wrap 2", "[60]", "[30][30]")); ImageIcon icon = new ImageIcon(getImageLibrary() .getSmallUnitTypeImage(ut, !enable)); JLabel name = Utility.localizedLabel(ut); name.setEnabled(enable); JLabel gold = Utility.localizedLabel(StringTemplate .template("goldAmount") .addAmount("%amount%", price)); gold.setEnabled(enable); newButton.setEnabled(enable); newButton.add(new JLabel(icon), "span 1 2"); newButton.add(name); newButton.add(gold); newButton.setActionCommand(ut.getId()); newButton.addActionListener(this); buttons.add(newButton); add(newButton, "grow"); } add(okButton, "newline 20, span, tag ok"); setSize(getPreferredSize()); revalidate(); shouldEnable = player.checkGold(europe.getUnitPrice(first(units))); }