Menu

Can not type alt key into swingtextfields after focusing to DJBrowser

Help
2017-12-12
2018-01-24
  • benchpresser

    benchpresser - 2017-12-12

    To generate the issue (latest dj + swt4.3 + java 1.8 current + IE 11.0)

    • add a simple swing JTextField to a simple djbrowser test example application. (Simple Web Browser example in the demo for example).
    • add an awt TextField to the application.
    • navigate the dj browser to google.com or set the html content to <html><input type="text"></html>
    • focus to the input field on the djbrowser.
    • focus to the swing text field. try typing a character which needs alt key combination for example @ or |. It will fail.
    • focus to the awt textfield and focus to the swing textfield back. You can type @ again.
    • focus from dj browser to the awt textfield and then to swing textfield. You can type @.

    Clues:
    Problem occurs when focused from djbrowser (html input) to swing textfield.
    On the case for example when you can not type @ into the swing textfield, If you perform alt+tab and maximize the application problem cleared, you may type @ aganin. Of if you show a dummy JOptionPane message, again the problem disappears. Or jump to an awt textfield and returning back to swing solves it.

    The fault is not on dj, it is purely a swt problem. If you remove dj browser and a textfield of swt and focus to that, and then focus to swing textfield, you can not type @ as the same scenario above.

    Problem is focus issue, probably started with java 1.7, when we have double blinks on focused swingtextfield and browser. (Focus seems on both components)

    Any idea to solve the issue? Or any opened swt ticket to vote?

     

    Last edit: benchpresser 2017-12-12
  • benchpresser

    benchpresser - 2018-01-24

    Thanks for the reply. I solved by using a temporarily awt text field, when focus set from dj browser to an swing textfield, this temp awt object gets the focus first and redirects to swing.

     

Log in to post a comment.