Skip to Main Content

Java SE (Java Platform, Standard Edition)

FXML + DisplayShelf Example

866629Mar 13 2013 — edited Mar 15 2013
Hi There,

I'm playing around with the displayShelf sample that comes with Netbeans and I'm dabbling in FXML for the first time.
However, for the most part I'm coping with it, but one thing is pissing me off big time. No matter how hard I try
with using the example in conjunction with Scene Builder - FXML, for the life of me I cannot seem to get
setOnKeyPressed in this displayShelf example to work.

Basically I'm using the example as is, inside the controller class the only difference is that I do not use the init, or start
method from this displayShelf sample:

Shelf shelf = new Shelf(images);
displayShelf.getChildren().add(shelf);

whereby ...

@FXML
private HBox displayShelf;

This HBox is added to other layouts, hence the need to use it.

In FXML the displayShelf is a HBox, that has Focus Travsersable checked in Scene Builder. I even tried under the
Code Accordion tab in Scene Builder to assign a #handleKeyInput from my controller class. But even this has no
effect. Can anyone enlighten me on how to get this working?

Edited by: 863626 on 13/03/2013 16:19
This post has been answered by jsmith on Mar 14 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2013
Added on Mar 13 2013
6 comments
515 views