# Swingbook Demo program
//********************Start***********************
import javax.swing.*;
import java.awt.*;
public class Swingbook extends JFrame
{
JButton b1,b2;
public Swingbook()
{
Container c = getContentPane();
c.setLayout(new FlowLayout());
b1=new JButton("OK");
b2=new JButton();
c.add(b1);
c.add(b2);
b1.setText("Cancel");
// b2.setBackground(Color.RED);
setSize(300,300);
setVisible(true);
}
public static void main(String[] args) {
Swingbook aw=new Swingbook();
}
}
//*******************************************End
No comments:
Post a Comment
Welcome, happy learning