SQL RightJoin: select e.ename, d.loc, d.deptno from emp e right outer join DEPT d on e.deptno=d.deptno
Query Result:


package javafxtemplate1;

import java.sql.SQLException;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.TreeView;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.paint.Color;
public class JavaFXTemplate1 extends Application {
public void start(Stage primaryStage) {
Group groot = new Group();
String str1 = "Selected ";
TreeView<String> treeView = TreeViewUtil.getTreeView();
HBox Hroot = new HBox(treeView);
Hroot.setStyle("-fx-padding: 10;" +
"-fx-border-style: solid inside;" +
"-fx-border-width: 2;" + "-fx-background-color:#3c7fb1;"+
"-fx-border-insets: 5;" +
"-fx-border-radius: 5;" +
"-fx-border-color: blue;");
Scene scene = new Scene(groot, 350, 250);
primaryStage.setTitle("JavaFx TreeView");;

public static void main(String[] args) throws SQLException {
class DemoEventHandler1 implements EventHandler<ActionEvent>{

public void handle(ActionEvent event) {

class TreeViewUtil {
public static TreeView<String> getTreeView() {
TreeItem<String> depts = new TreeItem<>("Departments");

// Add items to depts
TreeItem<String> N10 = new TreeItem<>("New York");
TreeItem<String> D10 = new TreeItem<>("Dallas");
TreeItem<String> Ch10 = new TreeItem<>("Chicago");
TreeItem<String> B10 = new TreeItem<>("Boston");
depts.getChildren().addAll(N10, D10, Ch10, B10);
// Add employees for each dept
N10.getChildren().addAll(new TreeItem<>("KING"),
new TreeItem<>("Miller"),
new TreeItem<>("CLARK"));
D10.getChildren().addAll(new TreeItem<>("JONES"),
new TreeItem<>("SMITH"),new TreeItem<>("ADAMS"),
new TreeItem<>("SCOTT"),new TreeItem<>("FORD"));
Ch10.getChildren().addAll(new TreeItem<>("ALLEN"),
new TreeItem<>("WARD"),new TreeItem<>("JAMES"),
new TreeItem<>("TUTNER"),new TreeItem<>("Lola Ng"));
B10.getChildren().addAll(new TreeItem<>("PRESIDENT"));
// Create a TreeView with depts as its root item
TreeView<String> treeView = new TreeView<>(depts);
return treeView;

Runtime display: