2015-04-20 15:36:01 -07:00
|
|
|
|
//: gui/GridLayout1.java
|
2015-05-29 14:18:51 -07:00
|
|
|
|
// <20>2015 MindView LLC: see Copyright.txt
|
2015-04-20 15:36:01 -07:00
|
|
|
|
// Demonstrates GridLayout.
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
import java.awt.*;
|
|
|
|
|
import static net.mindview.util.SwingConsole.*;
|
|
|
|
|
|
|
|
|
|
public class GridLayout1 extends JFrame {
|
|
|
|
|
public GridLayout1() {
|
|
|
|
|
setLayout(new GridLayout(7,3));
|
|
|
|
|
for(int i = 0; i < 20; i++)
|
|
|
|
|
add(new JButton("Button " + i));
|
|
|
|
|
}
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
run(new GridLayout1(), 300, 300);
|
|
|
|
|
}
|
|
|
|
|
} ///:~
|