Skip to content
Advertisement

Tag: javafx-2

JavaFX 2 set/get cursor position

How can I set/get the cursor’s position in JavaFX 2? I tired googling the answer but found nothing useful. All I can do is setting the cursor’s style. Answer You can use robot for that purpose: AWT robot: http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Robot.html or glass robot: com.sun.glass.ui.Robot; which could be created with: com.sun.glass.ui.Application.GetApplication().createRobot(); To get the cursor position, see other post for this question

RequestFocus in TextField doesn’t work

I use JavaFX 2.1 and I created GUI using FXML, in the controller of this GUI I added myTextField.requestFocus();. But I always get the focus in the other control. Answer At the time of initialize() controls are not yet ready to handle focus. You can try next trick: For tricky complex applications (like Pavel_K has in the comments) you may

Javafx Pane vs Region?

According to the documentation, both Region and Pane will resize any resizable child nodes to their preferred size, but will not reposition them. So i can’t see where the differencies between these …

Advertisement