This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ImageView image = new ImageView(new Image(getClass().getResourceAsStream("/files/cover_photo.jpeg"))); | |
| image.setScaleZ(50); // set Z-Axis index | |
| image.setOpacity(.5); // set fade value | |
| image.setFitHeight(600); // set image height | |
| image.setFitWidth(600); // set image width | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Polygon polygon = new Polygon(); // Create object of Polygon | |
| polygon.setFill(Color.valueOf("#a1291e")); // background color of Polygon | |
| polygon.getPoints().addAll(new Double[]{ // Points for Polygon, there can more points | |
| 0.0, 0.0, | |
| 100.0, 200.0, | |
| 200.0, 100.0}); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Ellipse elipse = new Ellipse(); // Create object of Ellipse | |
| elipse.setCenterX(100); // X Position of Ellipse | |
| elipse.setCenterY(100); // Y Position of Ellipse | |
| elipse.setRadiusX(50); // X Radius of Ellipse | |
| elipse.setRadiusY(80); // Y Radius of Ellipse | |
| elipse.setFill(Color.valueOf("#685e5d")); // hex color value for Ellipse | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Rectangle rect = new Rectangle(); // Create object of Rectangle | |
| rect.setX(20); // X Position of Ellipse | |
| rect.setY(20); // Y Position of Ellipse | |
| rect.setWidth(100); // Width of Rectangle | |
| rect.setHeight(100); // Height of Rectangle | |
| rect.setArcHeight(35); // Arc Height of Rectangle | |
| rect.setArcWidth(35); // Arc Width of Rectangle | |
| rect.setFill(Color.valueOf("#a1291e")); // hex color value for Rectangle | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Circle circle = new Circle(); // Create object of JavaFX Circle | |
| circle.setCenterX(200); // X Position of circle | |
| circle.setCenterY(200); // Y Position of circle | |
| circle.setRadius(100); // Radius of circle | |
| circle.setFill(Color.valueOf("#685e5d")); // hex color value for circle | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import javafx.application.Application; | |
| import javafx.geometry.HPos; | |
| import javafx.geometry.Pos; | |
| import javafx.geometry.VPos; | |
| import javafx.scene.Scene; | |
| import javafx.scene.layout.GridPane; | |
| import javafx.scene.paint.Color; | |
| import javafx.scene.shape.Circle; | |
| import javafx.scene.shape.Ellipse; | |
| import javafx.scene.shape.Polygon; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Fruits list | |
| final ListView<String> lvFruits = new ListView<>(); | |
| // Add the items to the List | |
| ArrayList<String> fruits = new ArrayList<String>(); | |
| fruits.add("Apple"); | |
| fruits.add("Orange"); | |
| fruits.add("Banana"); | |
| fruits.add("Apricots"); | |
| fruits.add("Avocados"); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Enable multiple selection | |
| lvFruits.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.util.ArrayList; | |
| import javafx.application.Application; | |
| import javafx.beans.value.ChangeListener; | |
| import javafx.beans.value.ObservableValue; | |
| import javafx.scene.Scene; | |
| import javafx.scene.control.ListView; | |
| import javafx.scene.control.SelectionMode; | |
| import javafx.scene.layout.StackPane; | |
| import javafx.stage.Stage; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | lvFruits.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() { | |
| public void changed(ObservableValue<? extends String> ov, | |
| final String oldvalue, final String newvalue) { | |
| System.out.println("New Value: " + newvalue+"\tOld Value: " + oldvalue); | |
| } | |
| }); | 
OlderNewer