Friday, September 26, 2008
Show Icon on The Button
import javax.swing.*;
import java.awt.*;
public class IconButton{
public static void main(String[] args){
JFrame frame = new JFrame("Swing Icon Example");
JButton button = new JButton("My Button");
Icon imgicon = new ImageIcon("smiley_icon.gif");
JPanel panel = new JPanel();
button.setIcon(imgicon);
panel.add(button);
frame.add(panel, BorderLayout.NORTH);
frame.setSize(380, 380);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Subscribe to:
Post Comments (Atom)
2 comments:
Nice Post
SEO Services
I did this , but i got error on this, can u clear me Car DVD Systems
Post a Comment