GridLayout°ü¸®ÀÚ¸¦ º¸¿©ÁÖ´Â ¿¹Á¦
GridLayoutTest.java
import java.awt.*;
public class GridLayoutTest extends Frame {
public GridLayoutTest() {
Panel p1 = new Panel(new GridLayout());
p1.add(new Button("Button 1"));
p1.add(new Button("Button 2"));
p1.add(new Button("Button 3"));
p1.add(new Button("Button 4"));
p1.add(new Button("Button 5"));
Panel p2 = new Panel(new GridLayout(2, 3));
p2.add(new Button("Button 1"));
p2.add(new Button("Button 2"));
p2.add(new Button("Button 3"));
p2.add(new Button("Button 4"));
p2.add(new Button("Button 5"));
add("North", p1);
add("Center", p2);
}
public static void main(String[] args) {
GridLayoutTest f = new GridLayoutTest();
f.pack();
f.setTitle("GridLayout");
f.setVisible(true);
}
}
C:\JavaExample\13>javac GridLayoutTest.java
C:\JavaExample\13>java GridLayoutTest
GridLayout°ü¸®ÀÚ´Â ÄÁÅ×À̳ÊÀÇ ¿µ¿ªÀ» ÁÖ¾îÁø Çà°ú ¿ Å©±âÀÇ ¼¿µé·Î ³ª´©°í µ¿µîÇÑ Å©±âÀÇ °¢ ¼¿¿¡ ÄÄÆ÷³ÍÆ®µéÀ» Çϳª¾¿ À§Ä¡
jabookÀúÀÚ¸íÇÔ |
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå ÀÛ¼ºÀÚ:Àںϸâ¹ö ±è´ë¼º |