Application running on RedHat 7, touchscreen interface, written using JavaFX 8.
Keyboard has a 'lower keyboard' button. If the user selects a TextField component, then lowers the keyboard, selecting the same (still focused field) will popup the keyboard again.
If the user selects a TextArea component, the keyboard is initially displayed. If they then lower the keyboard, and select the same (still focused text area), the keyboard will not display.
If focus is lost and then gained in the TextArea, the keyboard will display.
Why is this so, and how do I make the keyboard show whenever the field is selected?
This is a little hackish but if I fully understand your question the following might work for you.
textArea.onTouchReleasedProperty().addListener(new ChangeListener<EventHandler<? super TouchEvent>>() {
public void changed(ObservableValue<? extends EventHandler<? super TouchEvent>> observable, EventHandler<? super TouchEvent> oldValue, EventHandler<? super TouchEvent> newValue) {
if(newValue) {
if(textArea.isFocused()) {
textArea.getParent().requestFocus();
}
textArea.requestFocus();
}
}
});
Related
I have an app with 2 pages. The first page is the main menu, and when you navigate to the 2nd page, a keyboard open himself inside a TextField (autofocus).
What I want to do is disabling every ways of closing the keyboard. Right now, it doesn't close when you submit, but that's the only thing I achieved to do.
The user can still close it with every other ways (in my case, it's the android navigation bar who has the left button who can dismiss it).
Is there any ways to keep the keyboard open during the whole time an user stays on a page?
EDIT:
I found this package : keyboard_visibility to do that inside initState:
KeyboardVisibilityNotification().addNewListener(onHide: () {
setState(() {
FocusScope.of(context).requestFocus(_focus);
});
});
Each time I hide the keyboard, onHide is called and I can execute some code. Here I try to focus the TextInput again to re-open the keyboard immediately. When the keyboard is hided, the function is called, but requestFocus doesn't seems to work.
Try this,
FocusScope.of(context).requestFocus(FocusNode());
I have a disabled button. On mouse hover of this disabled button, I need to display a popup using GWT.
I tried to wrap it inside a panel and coded mouse hover for the panel. But it's not working instantly all the time.
IMO you should try to avoid this situation. For example, if you just want to show a small tooltip you can use a different title for enabled and disabled state explaining the disabled cause.
If you still want to react to an over event on disable button you can use something like this.
SimplePanel p = new SimplePanel();
Button b = new Button("hover me to toggle disable"); p.add(b);
p.addDomHandler(ev -> button.setEnabled(!b.isEnabled()), MouseOverEvent.getType());
RootPanel.get().add(p);
Although as you already have noticed, the browser does not fire over events on disabled inputs. So if you move the mouse without passing through the panel and goes directly to the button you will not receive the event. You can fix this applying this style.
button.gwt-Button[disabled] {
pointer-events: none;
}
But probably this might have some downsides or might not work in all browsers.
I'm new to javafx. I made a simple app form.
It has
Anchor Pane
Pane
Text field
I run that app on touch screen device, but the virtual keyboard doesn't show up. The textfield already focused.
I'm using JDK 8u25, scene builder 2.0.
According to what I read, http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/embed.htm
The virtual keyboard is shown automatically when a text input field is in focus. Note that the control that is associated with the keyboard remains visible when the keyboard is displayed. There is no need to push the parent stage up.
What should I do? Thanks in advance.
Adding the following arguments to your VM Options should allow the virtual keyboard to pop up:
-Dcom.sun.javafx.isEmbedded=true -Dcom.sun.javafx.virtualKeyboard=javafx
After that, you can specify the keyboard format as indicated in the JavaFX: Working with JavaFX UI Components document.
For example, on a TextField named textField, use the following:
textField.getProperties().put("vkType", "numeric");
I have as question mark icon with hover text attached. If the user puts their mouse over the icon and waits a second, the hover text shows up. However, if the user gets impatient and clicks on the icon, nothing happens, ever.
How can I make it so the hover text shows up on a hover or on a click?
Thank you,
Greg
Currently you use "title" property to show a tooltip. If you add a click event, you run the risk of showing two "tooltips" at the same time. The clean solution is not to use "title" property at all and use a PopupPanel instead with a simple MouseOver handler:
myWidget.addDomHandler(new MouseOverHandler() {
#Override
public void onMouseOver(MouseOverEvent event) {
myTooltipPopupPanel.showRelativeTo(myWidget);
}
}, MouseOverEvent.getType());
Obviously, if you can add a MouseOverHandler directly to myWidget, there is no need to add it as a DomHandler.
I have a view with an editText but the keyboard doesn't show up. After lots of research the only suitable thing I could find was how to make the keyboard appear when first loading the view. However, if the user closes the keyboard it seems there is no way to get it back.
How can I make the keyboard appear every time the user enters the editText field?
Whenever you click in the EditText box to type the text, then android keyboard automatically open.