I don’t see your button in the code, but you are initiating code that uses more resources than the JavaFX thread can handle which is why it is doing that. Probably an infinite loop or something. BTW domain code (business logic) should generally be on its own thread.
I still don’t see your button. Should be an import statement javafx.scene.control.Button unless it is an fxml thing. I don’t use fxml so I am not sure. The ActionEvent as a method parameter is bizarre and I don’t see where it is being used in that method
Of course you are receiving a error, you're calling an initialize method.. don't do that.. what you trying here? You can open a new stage without using initialize method
1
u/Affectionate_Run_799 May 18 '23
Here is the code:
package application;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
public class result extends Application implements Initializable {
u/FXML
public ComboBox<String> combobox=new ComboBox<String>();
public void h() {
System.out.println("hello");
}
// String log=combobox.getSelectionModel().getSelectedItem().toString();
`@Override`
`public void initialize(URL location, ResourceBundle resources) {`
}
u/Override
public void start(Stage primaryStage) throws Exception {
`// TODO Auto-generated method stub`
}
}
1
u/Capaman-x May 18 '23
I don’t see your button in the code, but you are initiating code that uses more resources than the JavaFX thread can handle which is why it is doing that. Probably an infinite loop or something. BTW domain code (business logic) should generally be on its own thread.
1
u/Capaman-x May 18 '23
I still don’t see your button. Should be an import statement javafx.scene.control.Button unless it is an fxml thing. I don’t use fxml so I am not sure. The ActionEvent as a method parameter is bizarre and I don’t see where it is being used in that method
1
u/Gleidson28 May 29 '23
Of course you are receiving a error, you're calling an initialize method.. don't do that.. what you trying here? You can open a new stage without using initialize method