I'm trying to copy a symbol form an old java swing Application. This is the Old one:
And this is my attempt to copy this symbol:
beside that the two ellipses are not in the same dimension - If the Mouse isn't over the Textfield I want them to be displayed as Label but as soon as the mouse hovers about the Textfield it should show up.
Anyone any ideas how to implement ? Is there a css-style for something like this ?
My ( temporary ) solution looks like this:
public class CustomTextField {
private Group group;
private Label label;
private TextField textField;
public StdeTextField(String text){
label = new Label(text);
label.relocate(5,2.5);
textField = new TextField(text);
label.setOnMouseEntered(event -> {
group.getChildren().remove(label);
group.getChildren().add(textField);
textField.setText(label.getText());
});
textField.setOnMouseExited(event -> {
group.getChildren().remove(textField);
group.getChildren().add(label);
label.setText(textField.getText());
});
group = new Group();
group.getChildren().addAll(label);
}
public Group getGroup() {
return group;
}
}
The Label and the Text field has a offset, because I can't figure out how to get the Size of an Node if it's not rendered.