Link Details

Link 114517 thumbnail
User 168451 avatar

By aalmiray
via java.dzone.com
Published: Sep 15 2008 / 16:14

In Flying with Griffon, I created a simple scenario in Griffon, to show how this new Swing MVC framework functions and what some of its benefits are. A different approach, one that is potentially even more illustrative, is to take an existing Java desktop application and port it to Griffon. That is what I propose to do in this article.
  • 18
  • 0
  • 1561
  • 171

Comments

Add your comment
User 152955 avatar

Gregg Bolinger replied ago:

0 votes Vote down Vote up Reply

Cooked up a quick MigLayout version of the view. Not quite perfect but a good start. Looks pretty much the same. Probably is a better way:


application(title:'Anagrams', minimumSize:[297, 200], location:[50,50],
pack:true, locationByPlatform:true) {
menuBar( id: 'menuBar') {
menu(text: 'File', mnemonic: 'F') {
menuItem(aboutAction)
menuItem(exitAction)
}
}
panel(border:emptyBorder(12), layout:new MigLayout('fill')) {
label(text: 'Scrambled Word:')
textField(id: 'scrambledWord', text: bind {model.scrambledWord},
columns: 20, editable: false,
constraints: "wrap")
label(text: 'Your Guess:')
textField(id: 'guessedWord',
columns: 20,
constraints: "wrap")
label(id:'feedbackLabel', text: bind {model.feedback}, constraints: "wrap")
panel(name:'buttonPanel', layout:new FlowLayout(FlowLayout.RIGHT), constraints: "growx, span") {

button(action: guessWordAction)
button(action: nextWordAction)
}

bean( model, guessedWord: bind {guessedWord.text} )
}
}

User 5255 avatar

cd78304 replied ago:

0 votes Vote down Vote up Reply

Great! And many times simpler than the original. And it works, I successfully tried it.

User 250147 avatar

geertjan replied ago:

0 votes Vote down Vote up Reply

Me too. Good job Gregg. I'll write an article about this solution soon.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.