javafx unresolved location of an imageView - scenebuilder

so I am working with scene builder and I added an imageView to the anchor pane , and I used a picture inside it , but it keeps showing this yellow alert , I don't know if it is an error or not , will it affect my project ? how can I get rid of it ?

Related

Gluon Scene Builder Freezes

I'm configuring the style of my form that I want to change its background color, in the JavaFX CSS section there was 2 textfield; one for the tag(eg. -fx-border-color) and the other is the value in it. Everytime after I inputted the first textfield I began to switch to the value textfield but the scene builder suddenly freezes. I checked it on my task manager but I found it that it doesn't consume cpu and its instance is still there. What could be the problem?
I had the same issue of the Scene Builder freezing when adding a Tab element to a TabPane etc, and first Running the SceneBuilder application as an Administrator and manually opening the the .fxml file from the Scene Builder has solved this issue. This might not be a permanent fix, but it will be a temporary workaround.

JavaFX - How to load a specific AnchorPane's contents from an FXML file?

I'm trying to make an application which switches between scenes back and forth however I need to load a specific AnchorPane's contents into another AnchorPane when the scene switches back. For Example:
In my FXML1, I have a hierarchy that looks like this:
AnchorPane0
----SplitPane
--------AnchorPane1
--------AnchorPane2
In FXML2 the hierarchy is just this:
AnchorPane0
So I load FXML1, then I have a button that switches scenes loading FXML2.AnchorPane0 into FXML1.AnchorPane2. I have a back button in FXML2.AnchorPane0 that needs to load the original scene of FXML1.AnchorPane2 into FXML1.AnchorPane2. Right now my back button loads all 4 containers of FXML1 into FXML1.AnchorPane2. So my questions is, how do I load a specific container's contents preferably without making FXML1.AnchorPane2 its own FXML? Do I need to write a get method for the FXML1.AnchorPane2 to access its contents or is there a way to return an AnchorPane with all of its contents in place already?
I found the solution as shown below:
AnchorPane loader = FXMLLoader.load(getClass().getResource("myFXML.fxml"));
SplitPane spane = (SplitPane) loader.getChildren().get(0);
AnchorPane pane = (AnchorPane) spane.getItems().get(1);
foregroundAnchorPane.getChildren().setAll(pane);

JavaFX DatePicker hide on mouseExited

How do i set this kind of behaviour?, currently the hover(mouseEntered) is fine, it shows up the DateChooser whenever the cursor goes inside the DatePicker, but whenever the mouse exits from the DatePicker it hides the DateChooser. I can´t find such method that gives access to the DateChooser itself.
It´s only fixed to not close the DateChooser when the cursor goes under the DatePicker, but the DateChooser should be close whenever the mouse goes out from it.
datePicker.setOnMouseEntered((event)->{datePicker.requestFocus();datePicker.show();});
datePicker.setOnMouseExited((event)->{if(event.getY()<23)datePicker.hide();});
Accessing the skin allows you to access the content of the popup which allows you access to the popup's Scene, which allows you to add a onMouseExited handler to that scene for hiding the popup:
EventHandler<MouseEvent> exitHandler = e -> datePicker.hide();
datePicker.setOnShown(evt -> {
DatePickerSkin skin = (DatePickerSkin) datePicker.getSkin();
Scene sc = skin.getPopupContent().getScene();
sc.setOnMouseExited(exitHandler);
});
Not a nice solution, since it requires accessing the skin located in the com.sun packages, but it is a solution.

Move ButtonType JavaFX in a Dialog

I'm working in a Dialog in JavaFX , the user have to insert a keyword in a textfield , then have to press a buttontype that I have created like this:
ButtonType find= new ButtonType("Find");
Here my problem, the button always stays in the lower right corner of the dialog, so , I want to put where I want. In the case was a button I would solve with a Pane and SetLayoutX/SetLayoutY, but I don't know how to do with Buttontype.

javafx how to add several elements in one window?

I'm using eclipse with scene builder.
I have build a new fxml document with:
- 2 labels
- one table view
I want to add several of this element into other window (i.e. add several of this element into tilePane).
How can I do it ?
When I'm trying to do this:
Pane pane1 = (Pane)loader.load();
Pane pane2 = (Pane)loader.load();
tilePaneRootLayout.getChildren().add(pane1);
tilePaneRootLayout.getChildren().add(pane2);
I'm getting empty window.
1. why this happen ?
2. how can I solve it ?
Thanks
Create a new loader for each new Pane

Resources