java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
- All Implemented Interfaces:
- ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants
- Direct Known Subclasses:
- BasicArrowButton, MetalComboBoxButton
- See Also:
- Top Examples, Source Code,
XMLEncoder
protected void configurePropertiesFromAction(Action a)
- See Also:
AbstractButton.setAction(javax.swing.Action)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public AccessibleContext getAccessibleContext()
- See Also:
- JComponent, Accessible
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String getUIClassID()
- See Also:
UIDefaults.getUI(javax.swing.JComponent)
, JComponent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isDefaultButton()
- See Also:
isDefaultCapable()
, JRootPane.setDefaultButton(javax.swing.JButton)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isDefaultCapable()
- See Also:
JRootPane.setDefaultButton(javax.swing.JButton)
, isDefaultButton()
, setDefaultCapable(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JButton()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JButton(String text)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1169]Create a button on a form
By dynamic_ax { at } yahoo { dot } com on 2005/03/11 12:44:25 Rate
import javax.swing.*;
import java.awt.event.*;
public class buttonEx extends JFrame implements ActionListener {
JButton button1 = new JButton ( "Click Me" ) ;
public buttonEx ( ) {
setTitle ( "SWU" ) ;
button1.addActionListener ( this ) ;
getContentPane ( ) .add ( button1 ) ;
setSize ( 300,100 ) ;
setVisible ( true ) ;
setResizable ( false ) ;
pack ( ) ;
}
public void actionPerformed ( ActionEvent e ) {
if ( e.getSource ( ) ==button1 )
JOptionPane.showMessageDialog ( null,"leigh100781","MSG",JOptionPane.INFORMATION_MESSAGE ) ;
}
public static void main ( String [ ] args ) {
new buttonEx ( ) ;
}
}
public JButton(String text,
Icon icon)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JButton(Action a)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JButton(Icon icon)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected String paramString()
- See Also:
- AbstractButton
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeNotify()
- See Also:
JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setDefaultCapable(boolean defaultCapable)
- See Also:
isDefaultCapable()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void updateUI()
- See Also:
- AbstractButton
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples