Sat Feb 09, 2013 12:29 am
import java.awt.*;
public class FlowLayoutExample extends Frame {
private boolean isApplet = true;
public FlowLayoutExample() {
setLayout(new FlowLayout());
setFont(new Font("Arial", Font.PLAIN, 15));
add(new Button("Btn1"));
add(new Button("Btn2"));
add(new Button("Btn3"));
add(new Button("Btn4"));
add(new Button("Btn5"));
}
public boolean handleEvent(Event e) {
if (e.id == Event.WINDOW_DESTROY) {
if (isApplet) {
dispose();
return true;
} else {
System.exit(0);
}
}
return super.handleEvent(e);
}
public static void main(String args[]) {
FlowLayoutExample window = new FlowLayoutExample();
window.isApplet = false;
window.setTitle("FlowLayoutExample Demo");
window.pack();
window.show();
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.