Guest User

rrees

a guest
Jan 21st, 2008
351
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import static java.awt.GridBagConstraints.*
  2.  
  3. import javax.swing.*
  4. import java.awt.*
  5.  
  6. import groovy.swing.SwingBuilder
  7.  
  8. swing = new SwingBuilder()
  9.  
  10. frame = swing.frame(preferredSize: [400, 600], pack: true, show: true) {
  11.     gridBagLayout()
  12.     label(text: 'Name 1',
  13.         constraints: gridBagConstraints(gridx: 0, gridy: 0, weightx: 0.1, fill: HORIZONTAL))
  14.     textField( columns: 100,
  15.         constraints: gridBagConstraints( gridx: 1, gridy: 0, gridwidth: 2, weightx: 1.0, fill: HORIZONTAL))
  16.     label(text: 'Name 2',
  17.         constraints: gridBagConstraints(gridx: 0, gridy: 1, weightx: 0.1, fill: HORIZONTAL))
  18.     textField( constraints: gridBagConstraints(gridx: 1, gridy: 1, weightx: 1.0, fill: HORIZONTAL))
  19.     tabbedPane( constraints: gridBagConstraints(gridx: 0, gridwidth: 2, weightx: 1.0,
  20.                      gridy: 2, weighty: 1.0, fill: BOTH) ) {
  21.         label('Inside Details 1', title: 'Details 1')
  22.         scrollPane( title: 'Details 2') {
  23.             table {
  24.                 tableModel(list: [[forename: 'Robert', surname : 'Rees'], [forename: 'Joel', surname: 'Coen']]) {
  25.                             propertyColumn(header: 'Forename', propertyName: 'forename')
  26.                             propertyColumn(header: 'Surname', propertyName: 'surname')
  27.                         }
  28.                   }
  29.             }
  30.          label('Inside Details 3', title: 'Details 3')
  31.     }
  32. }
RAW Paste Data