header.setSpacing(5);
header.setPadding(new Insets(20, 0, 5, 0));
header.setAlignment(Pos.CENTER);
Label labelSurrounding = new Label("Umgebung:");
ChoiceBox<Object> choices = new ChoiceBox<Object>();
choices.setItems(FXCollections.observableArrayList("Automatisch", new Separator(), "Umgebungen bearbeiten ..."));
choices.getSelectionModel().selectFirst();
header.getChildren().addAll(labelSurrounding, choices);
mainBox.getChildren().add(header);
/*
* The left-side content
*/
HBox content = new HBox();
content.setPadding(new Insets(10, 15, 10, 20));
content.setSpacing(10);
ListView<String> list = new ListView<String>();
ObservableList<String> listItems = FXCollections.observableArrayList("WLAN", "Bluetooth-PAN");
list.setItems(listItems);
list.setPrefWidth(200);
// Create a CellFactory for ListCells
list.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {
@Override public ListCell<String> call(ListView<String> list) {
return new NetworkCell();
}
});
content.getChildren().add(list);
/*
* The right-side content
*/
GridPane grid = new GridPane();
// grid.setGridLinesVisible(true);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(18, 5, 8, 15));
AquaFx.setGroupBox(grid);
Label labelStatus = new Label("Status:");
GridPane.setHalignment(labelStatus, HPos.RIGHT);
grid.add(labelStatus, 0, 0, 2, 1);
Label labelConnected = new Label("Verbunden");
labelConnected.setStyle("-fx-font-weight: bold;");
grid.add(labelConnected, 2, 0);
Button btnDisableWlan = new Button("WLAN deaktivieren");
GridPane.setHalignment(btnDisableWlan, HPos.RIGHT);
grid.add(btnDisableWlan, 3, 0);
Label labelCurrent = new Label("\"WLAN\" ist mit \"PrettyFlyForAWiFi\" verbunden und \n hat die IP-Adresse 192.168.0.104.");
labelCurrent.setStyle("-fx-font-size: 11");
grid.add(labelCurrent, 2, 2, 3, 1);
Label labelNetworkName = new Label("Netzwerkname:");
GridPane.setHalignment(labelNetworkName, HPos.RIGHT);
grid.add(labelNetworkName, 0, 3);
ChoiceBox<Object> choicesNetwork = new ChoiceBox<Object>();
choicesNetwork.setItems(FXCollections.observableArrayList("PrettyFlyForAWiFi", new Separator(),
"Mit anderem Netzwerk verbinden ...", "Netzwerk anlegen"));
choicesNetwork.getSelectionModel().select(2);
GridPane.setHalignment(choicesNetwork, HPos.RIGHT);
GridPane.getHgrow(choicesNetwork);
grid.add(choicesNetwork, 1, 3, 3, 1);