Write a Java applet that demonstrates the behavior of a FlowLayout by demonstrating some buttons. The program should have a main method to execute the applet
import java.awt.Button;
import java.awt.FlowLayout;
imporjava.awt.Frame;
public class FlowLayouttest extends Frame
{
public FlowLayouttest()
{
setLayout(new FlowLayout()); add(new Button("First"));
add(new Button("Second")); add(new Button("Third"));
add(new Button("Fourth")); add(new Button("Fifth")) ;
setSize(200,200);
}
public static void rnain(String a())
{
new FlowLayouttest().setVisible(true);
import java.awt.FlowLayout;
imporjava.awt.Frame;
public class FlowLayouttest extends Frame
{
public FlowLayouttest()
{
setLayout(new FlowLayout()); add(new Button("First"));
add(new Button("Second")); add(new Button("Third"));
add(new Button("Fourth")); add(new Button("Fifth")) ;
setSize(200,200);
}
public static void rnain(String a())
{
new FlowLayouttest().setVisible(true);
}
}
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment