List of usage examples for javafx.scene Node requestFocus
public void requestFocus()
From source file:ambroafb.general.AnnotiationUtils.java
private static void changeNodeTitleLabelVisual(Node node, String explain) { Parent parent = node.getParent();/*from ww w . ja v a 2s . c o m*/ Label nodeTitleLabel = (Label) parent.lookup(".validationMessage"); if (explain.isEmpty()) { if (default_colors_map.containsKey(nodeTitleLabel)) {// This order of 'if' statements is correct! nodeTitleLabel.setTextFill(default_colors_map.get(nodeTitleLabel)); default_colors_map.remove(nodeTitleLabel); Tooltip.uninstall(nodeTitleLabel, toolTip); } } else { node.requestFocus(); toolTip.setText(GeneralConfig.getInstance().getTitleFor(explain)); toolTip.setStyle("-fx-background-color: gray; -fx-font-size: 8pt;"); Tooltip.install(nodeTitleLabel, toolTip); default_colors_map.putIfAbsent(nodeTitleLabel, nodeTitleLabel.getTextFill()); nodeTitleLabel.setTextFill(Color.RED); } }