My problem is that when I use setResizable(false) one white border is shown on my scene. When I don’t set it false works fine, but I need to set it false. Code: My ImageView is inside of my AnchorPane Answer I had the same issue, I resolved in this way: You have to set the scene before setting the resiz…
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.glas…
How to use FXMLLoader.load() – JavaFX 2
I am building a JavaFX application using the JavaFX Scene Builder. The interface was created in the Scene Builder and a FXML file (main.fxml) was created. To use the interface in my application I must load the FXML file using the FXMLLoader, but there is a problem because the load() method returns an Object, …
Headless environment error in java.awt.Robot class with MAC OS
I am trying to capture screen shots in my JavaFX application using Robot class, this is the code which I used in my application: It is working perfectly in windows operating system, but showing an error of headless environment in MAC OS at Robot robot = new Robot(); Answer This is to answer my own question, a…
Tab key navigation in JavaFX TextArea
How do I make hitting the Tab Key in TextArea navigates to the next control ? I could add a listener to cath de key pressed event, but how do I make te TextArea control to lose it focus (without knowing the next field in the chain to be focused) ? Answer This code traverse focus if pressing TAB and
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_…
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 …
Javafx 2.0 How-to Application.getParameters() in a Controller.java file
Considering the following sample. How to access to arguments/parameters of the application in the controller? Thank you. NB: I’ve tried to mix App.java and MyController.java in only one Class file, but didn’t help. App.java (simplified): MyController.java (simplified): MyView.fxml (simplified): An…