import javax.swing.*; import java.awt.*; import javax.swing.border.*; public class Test16 extends JFrame { Test16(){} public void createLayout(){ this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this { title = "Welcome" content = panel { border = raised bevel border layout = border layout { north = scrollpane of panel of grid layout { row = { textarea { rows = 10 columns = 10 text = "A 10 by 10 textarea" } tree { } } } center = panel of grid layout { row = { label { text = "This an JLabel" } button { text = "This is a JButton" } slider { } } row = { radiobutton { text = "JRadioButton in a group" group = radiogroup1 selected = true } textfield { text = "a JTextField" } progressbar { value = 23 } } row = { checkbox { text = "a JCheckBox in a group" } combobox { } togglebutton { text = "a JToggleButton" group = someGroup } } row = { radiobutton { text = "another JRadioButton" group = radiogroup1 } label { } togglebutton { text = "another JToggleButton" group = someGroup selected = true } } } } } }; this.pack(); this.setVisible(true); } public static void main(String[] ps) { Test16 w = new Test16(); w.createLayout(); } }