To be clear, the blog writer did the best he could & acknowledged that the 
approach he was forced to take was fragile & incomplete.


Neil



From:   ngalarn...@abinitio.com
To:     openjfx-dev@openjdk.java.net, 
Date:   11/07/2014 09:01 AM
Subject:        Can a Button refuse focus?
Sent by:        "openjfx-dev" <openjfx-dev-boun...@openjdk.java.net>



Can a control in JavaFX refuse focus?

Often you don't want buttons in a toolbar to receive focus.

Although the ToolBar javadoc states that focusTraversable is set to false, 

in Ensemble8, the buttons in the toolbar both are in the focus traversal 
cycle & receive focus when clicked on.

In this post (
http://bekwam.blogspot.co.nz/2014/11/javafx-cut-copy-and-paste-from-toolbar.html

) linked to from FX Experience, the fellow does a fragile & incomplete 
workaround for this problem.

Making the button not be focus traversable isn't good enough (if I 
understand it correctly), because the user could still click on the button 

& then it would take focus.

Node.isCanReceiveFocus() is, of course, not overridable, so that avenue is 

blocked.


Thanks,

Neil





 
NOTICE from Ab Initio: This email (including any attachments) may contain 
information that is subject to confidentiality obligations or is legally 
privileged, and sender does not waive confidentiality or privilege. If 
received in error, please notify the sender, delete this email, and make 
no further use, disclosure, or distribution. 

Reply via email to