Answer the question
In order to leave comments, you need to log in
Why won't the javafx window launch??
There is a window with a TableView, in the controller I pass it a list with data, but it does not start.
I don’t remember exactly how I did it, but I received and showed the data, now it doesn’t show and starts.
Контроллер
public class FilterController implements Initializable {
public TableView<Filter> tableView;
public TableColumn<Filter, String> columnWord;
public TableColumn<Filter, Integer> columnFrequency;
@Override
public void initialize(URL location, ResourceBundle resources) {
Filter filter = new Filter();
columnWord.setCellValueFactory(new PropertyValueFactory<>("word"));
columnFrequency.setCellValueFactory(new PropertyValueFactory<>("number"));
tableView.setItems(filter.wordAndNumber());
}
}
ObservableList<Filter> wordAndNumber(){
ObservableList<Filter> list = FXCollections.observableArrayList();
String[] strings = delSymbol().split(" ");
for (int i = 0; i < strings.length; i++) {
list.add(new Filter(strings[i], i));
}
return list;
}
public void start(Stage primaryStage) throws Exception {
AnchorPane pane = FXMLLoader.load(getClass().getResource("sampleFilter.fxml"));
Scene scene = new Scene(pane);
scene.setFill(Color.web("eff0f1"));
primaryStage.setResizable(false);
primaryStage.setTitle("Фильтр");
primaryStage.setScene(scene);
primaryStage.show();
}
Answer the question
In order to leave comments, you need to log in
The issue is resolved, because I do not receive text from the field, therefore it does not start.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question