iam new to the swings.
can anybody tell how to start my swings
examples. For example to run this program below
what the directory like jdk(?) must i have to be.
and any classpath required to put for them.
also i request whats the procedure to run this program.
import java.awt.*;
import javax.swing.*;
public class JButtons extends JFrame {
public static void main(
String[] args) {
new JButtons();
}
public JButtons() {
super("Using JButton");
WindowUtilities.setNativeLookAndFeel();
addWindowListener(new ExitListener());
Container content = getContentPane();
content.setBackground(Color.white);
content.setLayout(new FlowLayout());
JButton button1 = new JButton("Java");
content.add(button1);
ImageIcon cup = new ImageIcon("images/cup.gif");
JButton button2 = new JButton(cup);
content.add(button2);
JButton button3 = new JButton("Java", cup);
content.add(button3);
JButton button4 = new JButton("Java", cup);
button4.setHorizontalTextPosition(SwingConstants.LEFT);
content.add(button4);
pack();
setVisible(true);
}
}
thanx.