Switch to full style
Graphics and animation Java code examples
Post a reply

FlowLayout with window-Buttons Layout Example

Sat Feb 09, 2013 12:29 am

FlowLayout with window-Buttons Layout Example
java code
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();
}
}




Post a reply
  Related Posts  to : FlowLayout with window-Buttons Layout Example
 GridLayout-window with buttons     -  
 Window-Frame-with Diagonal Layout     -  
 containers use a border Layout as their default layout     -  
 Frame with Null Layout- set layout NULL     -  
 flash buttons     -  
 Creating Glass Buttons     -  
 JSF Radio Buttons Form     -  
 Skymiles v1.1 Menu buttons     -  
 specify a container's layout     -  

Topic Tags

Java AWT