Monday, May 4, 2020

Flow Layout Program - Layout Manager

import java.awt.*;
import java.awt.event.*;
class  Flow extends Frame
{
Flow(String s)
{
super(s);
setLayout(new FlowLayout());
for(int i=1;i<=9;i++)
add(new Button("Button No"+i));
setVisible(true);
setSize(300,300);
addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent we) {
                System.exit(0);
            } });
} }
class Test2
{
public static void main(String[] args)
{
Flow f= new Flow("Flow Layout");
} }

No comments:

Post a Comment