leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
445 stars 21 forks source link

Trigger keyboard for swing text fields on mobile #110

Open oeway opened 3 years ago

oeway commented 3 years ago

One nice thing about awt is that the text field are implemented as <input> which can trigger the virtual keyboard on touchscreen devices. Wondering if it's possible to do the same for swing text fields.

oeway commented 3 years ago

FYI: It seems the swing text field on Android device can trigger the virtual keyboard.

ghost commented 3 years ago

Didn't work for me. I have Swing text fields, but they don't trigger the soft keyboard. You can try on a tablet. I tried with an Apple iPad and a HUAWEI tablet:

Screenshot from HUAWEI tablet: no_soft_keyboard_small http://www.jekejeke.ch/example04/page.html

On a side note, CheerpJ seems to work fine with Chrome, Safari on Android and IOs devices. But didn't see a virtual keyboard triggered. As an extrem solution was thinking of porting the JavaFX keyboard:

JavaFX virtual keyboard https://stackoverflow.com/questions/26768523/javafx-virtual-keyboard

But this has the drawback that it wouldn't make good use of Android respectively IOs resources. Interestingly CheerpJ touch support is quite good, for example in the above example

one can move table columns around by touch. Woa!