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

Window-Frame-with Diagonal Layout

Sat Feb 09, 2013 1:01 am

Window with Diagonal Layout
java code
import java.awt.*;

public class CustomWindow extends Frame {
private boolean isApplet = true;

public CustomWindow() {
setLayout(new DiagonalLayout());
setFont(new Font("Aril", 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[]) {
CustomWindow window = new CustomWindow();
window.isApplet = false;

window.setTitle("Frame with Diagonal Layout Example");
window.pack();
window.show();
}
}




Post a reply
  Related Posts  to : Window-Frame-with Diagonal Layout
 difference between a Window and a Frame     -  
 Frame with Null Layout- set layout NULL     -  
 FlowLayout with window-Buttons Layout Example     -  
 containers use a border Layout as their default layout     -  
 specify a container's layout     -  
 BoxLayout usage example - Box-Layout     -  
 Layout with Nested JPanels     -  
 Slice and Export a Website Layout     -  
 Dynamic Frame-sets with java script protocols     -  
 multi-frameset and non-re-sizable html frame pages     -