Monday, 26 August 2013

Correct Focus Management: JavaFX and Swing Interop

Correct Focus Management: JavaFX and Swing Interop

I've been developing Swing applications for many years, and recently tried
getting my feet wet with JavaFX. Everything's been going well for the most
part, but I'm having problems with inter-operating Swing and JavaFX
components when it comes to focus.
Basically, is there a right way to manage focus between JavaFX and Swing?
In the application I'm making, each component requests for focus in the
window when the mouse enters it's bounds. Unfortunately, this makes JavaFX
components like Popup freeze in place, instead of auto-hiding as it is
defaulted to do when it loses focus.
Thank you in advance.
Edit: To be more clear, the Popup doesn't actually freeze, buttons and
other stuff work, but TextFields become ineditable. I'm sure other
controls suffer the same problem as well.

No comments:

Post a Comment