Code :
package javafxtemplate1;
import java.sql.SQLException;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.TableView;
//import javafx.scene.control.cell.PropertyValueFactory;
//import javafx.scene.control.cell.TextFieldTableCell;
//import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaFXTemplate1 extends Application {
@Override
public void start(Stage primaryStage) throws SQLException {
Group groot = new Group();
TableView<String> table1 = new TableView<>();
table1.setMaxWidth(200);table1.setMaxHeight(200);
table1.setStyle("-fx-background-color: ORANGE;");
groot.getChildren().add(table1);
Scene scene = new Scene(groot, 250, 150);
primaryStage.setScene(scene);
primaryStage.setTitle("TreeView");
primaryStage.show();
}
public static void main(String[] args) throws SQLException {
launch(args);
}
}
|