import java.awt.*;
import java.awt.event.*;
class Grid extends Frame
{
Grid(String s)
{
super(s);
setLayout(new GridLayout(3,4));
for(int i=1;i<=12;i++)
add(new Button("Button No"+i));
setVisible(true);
setSize(300,300);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
} });
} }
class Test3
{
public static void main(String[] args)
{
Grid f= new Grid("Grid Layout");
} }
import java.awt.event.*;
class Grid extends Frame
{
Grid(String s)
{
super(s);
setLayout(new GridLayout(3,4));
for(int i=1;i<=12;i++)
add(new Button("Button No"+i));
setVisible(true);
setSize(300,300);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
} });
} }
class Test3
{
public static void main(String[] args)
{
Grid f= new Grid("Grid Layout");
} }
No comments:
Post a Comment