@Override public void start(Stage stage) { TextArea desc1 = new TextArea(); desc1.setPrefColumnCount(10); desc1.setPrefRowCount(4); TextArea desc2 = new TextArea(); desc2.setPrefColumnCount(10); desc2.setPrefRowCount(4); VBox vb1 = new VBox(new Label("Description1"), desc1); VBox vb2 = new VBox(new Label("Description2"), desc2); SplitPane sp = new SplitPane(); sp.getItems().addAll(vb1, vb2); HBox root = new HBox(sp); root.setSpacing(10); root.setStyle( "-fx-padding: 10;" + "-fx-border-style: solid inside;" + "-fx-border-width: 2;" + "-fx-border-insets: 5;" + "-fx-border-radius: 5;" + "-fx-border-color: blue;"); Scene scene = new Scene(root); stage.setScene(scene); stage.setTitle("Using SplitPane Controls"); stage.show(); }
private VBox LeftArea() { System.out.println("Gui.leftarea()"); VBox leftArea = new VBox(); input = new TextField(); this.rawExile = new TextArea(); input.setPrefColumnCount(88); rawExile.setPrefColumnCount(88); rawExile.setPrefHeight(1530); input.setPrefHeight(50); input.setOnKeyReleased( new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent keyEvent) { if (keyEvent.getCode() == KeyCode.ENTER) { try { et.getOutputStream() .write(input.getText().getBytes(), 0, input.getText().getBytes().length); et.getOutputStream().flush(); input.setText(""); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }); leftArea.getChildren().add(rawExile); leftArea.getChildren().add(input); return leftArea; }
private VBox initGUIcenterLinks() { VBox senkrecht = new VBox(); HBox zeile1 = new HBox(10); zeile1.setPadding(new Insets(5, 5, 5, 5)); zeile1.setStyle(Css.boxgrau()); TextArea zustandDatenbank = new TextArea(); zustandDatenbank.getStyleClass().add("textarea80"); zustandDatenbank.setStyle(Css.focusrahmenWeg()); zustandDatenbank.setEditable(false); zustandDatenbank.setPrefRowCount(2); zustandDatenbank.setPrefColumnCount(23); zustandDatenbank.setWrapText(true); RahmenTitelWeiss rahmenZustandDatenbank = new RahmenTitelWeiss("Zustand der Datenbank", zustandDatenbank); Button knopfDatenbank = new Button("aktualisieren"); zeile1.getChildren().add(rahmenZustandDatenbank); zeile1.getChildren().add(knopfDatenbank); VBox zeile2 = new VBox(10); zeile2.setPadding(new Insets(10, 10, 10, 10)); zeile2.setStyle(Css.boxgrau()); HBox zeileTabelle = new HBox(10); Button knopfAlle = new Button("alle auswählen"); Button knopfKeinen = new Button("keinen auswählen"); zeileTabelle.getChildren().add(knopfAlle); zeileTabelle.getChildren().add(knopfKeinen); zeile2.getChildren().add(initGUItabelle()); zeile2.getChildren().add(zeileTabelle); VBox zeile3 = new VBox(10); zeile3.setPadding(new Insets(10, 10, 10, 10)); zeile3.setStyle(Css.boxhellblaugrau()); Button knopfDateiTextAlles = new Button("Projektstammdaten als Datei speichern (Text)"); Button knopfDateiXmlAlles = new Button("Projektstammdaten als Datei speichern (Xml)"); zeile3.getChildren().add(knopfDateiTextAlles); zeile3.getChildren().add(knopfDateiXmlAlles); VBox zeile4 = new VBox(10); zeile4.setPadding(new Insets(10, 10, 10, 10)); zeile4.setStyle(Css.boxhellblau()); Button knopfProjektAlles = new Button("alle Daten und Datein lokal speichern"); zeile4.getChildren().add(knopfProjektAlles); senkrecht.getChildren().add(zeile1); senkrecht.getChildren().add(zeile2); senkrecht.getChildren().add(zeile3); senkrecht.getChildren().add(zeile4); return senkrecht; }
private HBox initGUIcenterRechtsZeile7() { HBox zeile = new HBox(10); TextArea info = new TextArea(); info.setPrefRowCount(6); info.setPrefColumnCount(36); info.setWrapText(true); info.setEditable(false); RahmenTitelWeiss rahmenLoginname = new RahmenTitelWeiss("Info", info); ListView<String> gruppen = new ListView<String>(); gruppen.setPrefWidth(190); gruppen.setPrefHeight(50); RahmenTitelWeiss rahmenGruppen = new RahmenTitelWeiss("Gruppen", gruppen); zeile.getChildren().add(rahmenLoginname); zeile.getChildren().add(rahmenGruppen); return zeile; }
private HBox initGUIcenterRechtsDatenbank() { HBox zeile = new HBox(20); zeile.setPadding(new Insets(5, 5, 5, 5)); zeile.setStyle(Css.boxhellblaugrau()); TextArea antwortDatenbank = new TextArea(); antwortDatenbank.getStyleClass().add("textareaFlat"); antwortDatenbank.setStyle(Css.focusrahmenWeg()); antwortDatenbank.setEditable(false); antwortDatenbank.setPrefRowCount(3); antwortDatenbank.setPrefColumnCount(25); antwortDatenbank.setWrapText(true); RahmenTitelWeiss rahmenAntwortDatenbank = new RahmenTitelWeiss("Antwort Datenbank", antwortDatenbank); VBox senkrecht = new VBox(5); Label schildchenAktion = new Label("Aktion"); schildchenAktion.setStyle(CssExtras.titel()); ToggleGroup gruppe = new ToggleGroup(); RadioButton knopfArchivieren = new RadioButton("aktivieren"); knopfArchivieren.setToggleGroup(gruppe); RadioButton knopfLöschen = new RadioButton("löschen"); knopfLöschen.setToggleGroup(gruppe); senkrecht.getChildren().add(schildchenAktion); senkrecht.getChildren().add(knopfArchivieren); senkrecht.getChildren().add(knopfLöschen); Button knopfSenden = new Button("senden"); zeile.getChildren().add(rahmenAntwortDatenbank); zeile.getChildren().add(senkrecht); zeile.getChildren().add(knopfSenden); return zeile; }
@Override public void start(Stage primaryStage) { try { BorderPane root = (BorderPane) FXMLLoader.load(getClass().getResource("FinanceMainForm.fxml")); // ------------------------------------------------------------------------------------ // MD Alexis code // Grid to arrange buttons and text controls GridPane grid = new GridPane(); grid.setAlignment(Pos.TOP_LEFT); grid.setPrefWidth(400); // TODO: One column may be better, or a multicolumn single row for buttons. ColumnConstraints col1 = new ColumnConstraints(); col1.setPercentWidth(90); col1.setMinWidth(200); ColumnConstraints col2 = new ColumnConstraints(); col2.setPercentWidth(10); col2.setMinWidth(200); grid.getColumnConstraints().addAll(col1, col2); grid.setHgap(10); grid.setVgap(10); // grid.setGridLinesVisible(true); //Turn this on for debug and layout javafx.geometry.Insets ins = new javafx.geometry.Insets(5, 5, 5, 5); grid.setPadding(ins); // Fill the grid with controls Text scenetitle = new Text("Modeler"); scenetitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20)); grid.add(scenetitle, 0, 0, 2, 1); // Add Buttons----------------------------------------- bthRun.setOnAction(bthHandlerRun); grid.add(bthRun, 0, 2); // grid.add(child, columnIndex, rowIndex); // Add textArea control to show results textStatus.setPrefRowCount(10); textStatus.setPrefColumnCount(100); textStatus.setWrapText(false); textStatus.setPrefWidth(300); grid.add(textStatus, 0, 3); // -------------------Table View - use to display results // -------------------------------------------- // Set up table columns and their data sources TableColumn indexCol = new TableColumn("Index"); TableColumn yearCol = new TableColumn("Year"); yearCol.setCellValueFactory(new PropertyValueFactory<YearData, String>("year")); TableColumn balanceCol = new TableColumn("StartBalance"); balanceCol.setCellValueFactory( new PropertyValueFactory<YearData, String>("startBalanceFormatted")); TableColumn mktGainCol = new TableColumn("Gains"); mktGainCol.setCellValueFactory( new PropertyValueFactory<YearData, String>("marketGainsFormatted")); TableColumn incGoalCol = new TableColumn("Income Goal"); incGoalCol.setCellValueFactory( new PropertyValueFactory<YearData, String>("incomeGoalWithInflationFormatted")); TableColumn totalIncomeCol = new TableColumn("Total Income"); totalIncomeCol.setCellValueFactory( new PropertyValueFactory<YearData, String>("incomeTotalFormatted")); tableV .getColumns() .addAll(indexCol, yearCol, balanceCol, mktGainCol, incGoalCol, totalIncomeCol); grid.add(tableV, 0, 4); // ------------------------------- Chart --------------------------------------------- final CategoryAxis xAxis = new CategoryAxis(); final NumberAxis yAxis = new NumberAxis(); // final BarChart barchartResults = new BarChart<>(xAxis,yAxis); final AreaChart areachartResults = new AreaChart<>(xAxis, yAxis); areachartResults.setTitle("Results Chart"); xAxis.setLabel("Year"); yAxis.setLabel("Dollars"); // Series // TODO: Connect this to an observable list in ModelUtility // final XYChart.Series<int[], double[]> seriesBalance = new XYChart.Series(); final XYChart.Series<String, Double> seriesBalance = new Series<String, Double>(); seriesBalance.setName("Balance"); // seriesBalance.setData(MU.balanceDataList); areachartResults.setData(MU.balanceDataList); // Add the Series to the chart areachartResults.getData().addAll(seriesBalance); grid.add(areachartResults, 0, 5); // ------------------------------------------------------------------------------------ // Below lines are from initial project setup // Scene scene = new Scene(root,600,400); Scene scene = new Scene(grid, 1200, 600); scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); primaryStage.setScene(scene); primaryStage.show(); } catch (Exception e) { e.printStackTrace(); } }