Java Swing Applications - Window 8 Tablet - On-Screen Keyboard

When I click on a text box in a Java Swing application deployed on a Windows 8 tablet, the keyboard on the screen does not open automatically. Do I need to implement something to do this?

Or, are there any settings that need to be done explicitly to achieve this?

+4
source share
1 answer

First of all, does the input line appear in the text box? If so, you can try to do java.awt.Component.requestFocus () or java.awt.Component.requestFocusInWindow (). If both of them do not work, suppose a problem with your JVM and / or machine.

A particular component must be included and focused (as well as all parent components) to focus the text field. Although java properties should enable and activate new components by default, you can enforce them by doing setEnabled (true); and setFocusable (true); on your component. Focus is usually indicated by a flashing carriage.

Also make sure that you do not have strange mouse listeners that consume a mouse event.

If all else fails, an ADD mouse listener and a focus listener on your component to check if it has a receive focus and what ways to select it (using the tab key, using the mouse, through touch input).

Java is platform independent. Assuming you are using an AWT / Swing object, the underlying mechanics should be handled by the JVM automatically, whether in Windows 8 or Windows 98 (if it is supported by this version of java).

0
source

Source: https://habr.com/ru/post/1494711/


All Articles