-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaFX Cannot Get Focus In TextFields #167
Comments
I threw in a bit of a hack that requests focus when the mouse enters the Pane but seems to work. This could potentially be a JavaFX bug maybe:
Curious if there is a cleaner solution. Thanks! |
It's been a while since I worked on getting swing and javaFX to play nice. There might be some strange side effects with that code snipped but as you said it appears to work. I would also lean towards your thought that is some sort of bug/issue with the two UI libraries. If you don't need a very big toolbar, it might be easier to build the buttons in javaFX and call the swing controller as needed. |
I am also having trouble with the free text annotation in my JavaFX/TornadoFX application. At first, the free text could not gain focus at all, and I used the request focus on mouse entered workaround from @realumhelp's comment. But I use icepdf to view and annotate multiple PDF files simultaneously. The PDFs are open as tabs. Opening a single PDF twice is handled so that it cannot happen. The problem is, that the free text annotation works only in the first opened tab. In the others, the text box appears but I cannot write in it. Closing other tabs often fixes it. But sometimes the annotation does not work in any opened tab. Also the annotation selection using the select tool does not work properly as it does not draw the select rectangle around the annotation. Each tab creates a completely separate icepdf swing component mostly according to the JavaFX guide from the wiki (the controller, the swing node with the viewer…) and each swing node has its own
I tried creating custom JavaFX button and call
from So how could this be fixed, is there any progress on this issue? The full code for my View component that is embedded in a tab can be viewed here . The project can be downloaded and run. All code related to the viewer is in the |
I am running PdfFXViewer.java with no modifications and it works fine. However, when I add something else to the BorderPane I can no longer get focus inside of the icepdf Panels. I tried both OpenJDK11 /w OpenFX11 and JDK1.8.
For example add in PdfFXViewer.java:
It is like JavaFX is no longer giving up Focus over to Swing or something is throwing an Exception that is getting eaten in the background. I tried turning on logging without much success. If anyone has any ideas I'm all ears!
Thanks!
The text was updated successfully, but these errors were encountered: