Q:

Java - Flow Layout using Frame Demo

0

This Program is used to Demonstrate the Flow Layout Program

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

// Flow Layout

import java.awt.*;
import java.awt.event.*;

public class flow extends Frame
{
Button b1,b2,b3,b4;

flow()
{
setLayout(new FlowLayout());

// setLayout(new FlowLayout(FlowLayout.LEFT));

// setLayout(new FlowLayout(FlowLayout.RIGHT));

b1 = new Button("one");
b2 = new Button("two");
b3 = new Button("three");
b4 = new Button("four");

add(b1); add(b2); add(b3); add(b4);

addWindowListener(new w());
}

class w extends WindowAdapter
{ 
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
}

public static void main(String arg[])
{
flow ff = new flow();
ff.show();
ff.setBounds(0,0,300,300);
}
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now