CREATE TABLE data ( id serial PRIMARY KEY NOT NULL, key varchar(100) NOT NULL, value varchar(250) NOT NULL);
--module-path target/lib \
--add-modules=javafx.controls,javafx.base,javafx.graphics,commons.configuration,commons.csv,org.apache.logging.log4j
javafx.fxml.LoadException: No controller specified
package com.example.testmenu;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableView;
import javafx.stage.Stage;
public class HelloController {
@FXML
private Button btnAdd;
...
<BorderPane
fx:controller="com.example.testmenu.HelloController"
maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
>
fx:id
<Image fx:id="dialogImage" url="@image.png"/>
@FXML
private Image dialogImage;
if (dialogImage != null) {
System.err.println(String.format("The image url: %s",
dialogImage.impl_getUrl()));
}
The image url: file:/<путь к моему проекту>/src/main/resources/image.png
<Label fx:id="dialogImageLabel">
<graphic>
<ImageView fx:id="dialogImageView" fitHeight="128" fitWidth="128" pickOnBounds="true" preserveRatio="true">
<image>
<Image fx:id="dialogImage" url="@watchglass.png"/>
</image>
</ImageView>
</graphic>
</Label>
for (int i = 0; i != dialogImageLabel.getChildrenUnmodifiable()
.size(); i++) {
Node itemNode = dialogImageLabel.getChildrenUnmodifiable().get(i);
if (itemNode.getClass().getName().equals("javafx.scene.image.ImageView")) {
ImageView imageView = (ImageView) itemNode;
System.err.println(String.format("The child image url: %s",
imageView.getImage().impl_getUrl()));
}
}
то же самоеThe child image url: file:/<путь к проекту>/src/main/resources/картина.png
label.setOnMouseEntered(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
System.err.println(String.format("The label.bounds: %.2f %.2f,
Math.floor(label.getBoundsInLocal().getWidth()),
Math.floor(label.getBoundsInLocal().getHeight())));
The label.bounds: 54.00 18.00
label.setScaleX(0.82);
src/main/resources/application.properties:spring.datasource.url = jdbc:sqlite:${USERPROFILE}\\sqlite\\database_name.db
String.format("%s/src/main/resources/%s",
System.getProperty("user.dir"), resourceFileName);