Skip to content
daveray edited this page May 17, 2011 · 11 revisions

There are container creation functions which basically create JPanel instances with particular layouts. Here are some examples. Any place that a widget or list of widgets is expected, the widget coercion rules described above apply.

A FlowLayout with some items:

(flow-panel 
   :align :left
   :hgap 20
   :items ["Label" (action :handler alert "Button") "Another label"])

A GridLayout with 2 columns and a titled border:

(grid-panel
  :border "Properties"
  :columns 2
  :items ["Name" (text "Frank") 
          "Address" (text "123 Main St")])

A BorderLayout with labels at each position:

(border-panel :hgap 10 :vgap 10 :center "CENTER" :north "NORTH" :south "SOUTH" :east "EAST" :west "WEST")

There's also (mig-panel) which uses [MigLayout] (http://www.miglayout.com/), (vertical-panel), (horizontal-panel), (border-panel), etc.

Clone this wiki locally