Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added link to downloadable jar, updated info for wings 3.1

...

Code Block
class GuessingGame {
   GuessingGame(){
      def randomNr = (new Random().nextInt(10) + 1) as String
      def builder = new WingSBuilder()

      /* STitledBorder was removed in wings-3.1
      def border = SBorderFactory.createSTitledBorder(
                    SBorderFactory.createSLineBorder([0,0,255] as Color, 2),
                    "Guessing Game")
      */
      def border = SBorderFactory.createSLineBorder([0,0,255] as Color, 2)
      def font = new SFont( null, SFont.BOLD, 14 )

      def frame = builder.frame( title: "Guessing Game" ) {
         panel( border: border){
            gridLayout( columns: 1, rows: 5, vgap: 10)
            label("Hello World - this is wingS (+WingSBuilder&Groovy)!",
                  font: font)
            label("We want fun, so let's play a game!" +
                  "Try to guess a number between 1 and 10.")
            textField( id: "answer" )
            button( text: "Guess!", actionPerformed: { event ->
               def value = builder.answer.text
               if( value == randomNr ){
                  builder.message.text = "Congratulations! You guessed my number!"
               }else{
                  builder.message.text = "No - '${value}' is not the right number. Try again!"
               }
            })
            label( id: "message" )
         }
      }

      frame.visible = true
   }
}

Which is rendered in FireFox as

Team Members

Andres Almiray [aalmiray at users dot sourceforge dot net]

Download

Distributions

Pending.wingsbuilder-1.0

Installing

PendingJust drop the wingsbuilder jar file along with its dependencies into your weabpp's lib directory.

Pre-requisites

WingS 3.0 1 and Groovy 1.1-beta-2 are needed 5 are required to run WingSBuilder. 

Documentation

Alphabetical list of SwingBuilder compatible components

Element

Class

Notes

action

javax.swing.Action

same as SwingBuilder.action()

actions

Collection

same as SwingBuilder.actions()

bean

Object

same as SwingBuilder.bean()

borderLayout

SBorderLayout

 

boundedRangeModel

SDefaultBoundedRangeModel

 

boxLayout

SBoxLayout

 

button

SButton

 

buttonGroup

SButtonGroup

 

cardLayout

SCardLayout

 

checkbox

SCheckbox

 

closureColumn

DefaultTableColumn

same as SwingBuilder.closureColumn()

container

SComponent

placeholder for any SComponent

comboBox

SCombox

Obeys 'items' to populate model

dashedLineBorder

SBorder

 

desktopPane

SDesktopPane

 

dialog

SDialog

 

dottedLineBorder

SBorder

 

emptyBorder

SBorder

 

etchedBorder

SBorder

 

flowLayout

SFlowLayout

 

formattedTextField

SSormattedTextField

 

frame

SFrame

 

gbc

GridBagConstraints

same as SwingBuilder.gbc()

gridBagConstraints

GridBagConstraints

same as SwingBuilder.gridBagConstraints()

gridBagLayout

SGridBagLayout

 

gridLayout

SGridLayout

 

internalFrame

SInternalFrame

 

label

SLabel

 

lineBorder

SBorder

 

list

SList

 

loweredBeveldBorder

SBorder

 

loweredEtchedBorder

SBorder

 

menu

SMenu

 

menuBar

SMenuBar

 

menuItem

SMenuItem

 

map

java.util.Map

same as SwingBuilder.map()

optionPane

SOptionPane

 

panel

SPanel

 

passwordField

SPasswordField

 

popupMenu

SPopupMenu

 

progressBar

SProgressBar

 

propertyColumn

DefaultTableColumn

same as SwingBuilder.propertyColumn()

radioButton

SRadioButton

 

raisedBevelBorder

SBorder

 

raisedEtchedBorder

SBorder

 

scrollBar

SScrollBar

 

scrollPane

SScrollPane

 

separator

SSeparator

 

slider

SSlider

 

spinnerDateModel

SSpinnerDateModel

 

spinnerListModel

SSpinnerListModel

 

spinnerNumberModel

SSpinnerNumberModel

 

tabbedPane

STabbedPane

 

table

STable

 

tableModel

DefaultTableModel

same as SwingBuilder.tableModel()

tableColumn

STableColumn

 

textArea

STextArea

 

textField

STextField

 

toggleButton

SToggleButton

 

toolBar

SToolBar

 

tree

STree

 

widget

SComponent

placeholder for any SComponent

...

Element

Class

Notes

calendar

XCalendar

 

colorPicker

XColorPicker

Obeys 'red', 'blue' & 'green' properties or 'color'

division

XDivision

 

inplaceEditor

XInplaceEditor

 

popupFrame

XPopupFrame

 

scrollablePanel

XScrollablePanel

 

suggest

XSuggest

 

treeTable

XTreeTable

 

yuixGrid

YUIxGrid

 

xpageScroller

XPageScroller

 

xscrollPane

XScrollPane

 

xtable

XTable

 

Developers

Andres Almiray

Source Control

http://svn.codehaus.org/groovy-contrib/wingsbuilder

...

WingSBuilder uses Maven2 as its build tool, which means that if you want to
build your own version of WingSBuilder from source you'll need to have it
installed.  Follow the instructions at http://maven.apache.org
Once Maven2 is installed you will also need to install 4 files from the wingS
distribution (but it wouldn't hurt to check at http://mvnrepository.org
if they are already there). The files are:

   wings-3.01.jar
   wings-css-3.0.jar
   wingx-3.01.jar    wingx-cxx-3.0.jar

If the files are not found in any Maven2 repository the you'll need to
download the source from http://wingsframework.org, follow the compile &
install instructions, the jars should be at build/web/WEB-INF/lib
Install them on your local Maven2 repo with the following command

 mvn install:installFile -DgroupId=org.wings -Dversion=3.0 1 -Dpackaging=jar \
     -DartifactId=<depname> -Dfile=<jarfile>

where 'depname' is any of [wings, wings-css, wingx, wingx-cxx] with its
corresponding ' jarfile'

Contributing

Please contact the team members by e-mail.

...