Skip to content

Instantly share code, notes, and snippets.

@aalmiray
Last active December 14, 2015 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aalmiray/5023272 to your computer and use it in GitHub Desktop.
Save aalmiray/5023272 to your computer and use it in GitHub Desktop.
// View
application(title: 'Sample', sizeToScene: true, centerOnScreen: true) {
scene(fill: black, width: 400, height: 300) {
vbox(padding: 80) {
comboBox(id: 'combo')
noparent { combo.items = model.monthList }
button(loadAction)
}
}
}
// Model
import javafx.collections.*
class SampleModel {
List monthList = FXCollections.observableList([new Date()])
}
// Controller
import griffon.transform.Threading
class SampleController {
def model
@Threading(Threading.Policy.SKIP)
def load = {
def months = [new Date(), new Date()]
model.monthList.addAll(months)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment