void setTextToTempText(String text){
Connection connection = connectToBase();
Statement statement = null;
try {
statement = connection.createStatement();
statement.execute("INSERT INTO temptext VALUES ('" + text + "')");
} catch (SQLException ignored) {
} finally {
try {
assert statement != null;
statement.close();
assert connection != null;
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
class FilterController{
Filter filter = new Filter();
void setFilter(filter){
//то есть он должен передавать или принимать текст??
}
}
class FilterMain {
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();
}
}
public void actionFilter(ActionEvent actionEvent) {
FilterMain filterMain = new FilterMain();
try {
filterMain.start(new Stage());
} catch (Exception ignored) {
}
}
ObservableList<DataFilter> observableList(){
ObservableList<DataFilter> observableList = FXCollections.observableArrayList();
for (Object o : wordAndNumber().entrySet()) {
Map.Entry entry = (Map.Entry) o;
observableList.add(new DataFilter((String) entry.getKey(), (int) entry.getValue()));
}
return observableList;
}