×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Richard McDonald
Added: Sep 20, 2016 6:33 AM
Views: 7
Tags: javafx
Sets or clears the error highlight for <code>node</code>
  1.     /**
  2.      * Sets or clears the error highlight for <code>node</code>
  3.      *
  4.      * @param node
  5.      * @param state true sets the error, false clears the error
  6.      */
  7.     private void setError(Node node, boolean state) {
  8.         if (state) {
  9.             node.setStyle("-fx-background-color: pink");
  10.         } else {
  11.             node.setStyle("-fx-background-color: lightgreen");
  12.         }
  13.     }
  14.