Question: I do not know what to do . I have this error and the issue is I dont have a module - info.java file and

I do not know what to do. I have this error and the issue is I dont have a module-info.java file and it doesn't like when I try to make the module-info.java file. I am using netbeans and this is for a assignment that I have to make a javafx applitcation that allows users to update a database and the java program has to connect to the SQL database and add the info and then retrieves the info and the java program shows the user the database information
I have used chatGPT and classmates to help and they don't even know how I have this problem, I am struggling and any help would be greatly appreciated Sorry here is my code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
import static javafx.application.Application.launch;
public class Demo extends Application {
// Main method is not needed in JavaFX application when extending Application class
@Override
public void start(Stage stage){
Scanner input = new Scanner(System.in);
// JavaFX Application requires setting up a Stage (window) with a Scene (content)
// Database connection details
String user =""; // Initialize with your MySQL username
String pass =""; // Initialize with your MySQL password
Connection myConn = null;
Statement myStmt = null;
ResultSet myRs = null;
try {
// Establishing database connection
myConn = DriverManager.getConnection("jdbc:mysql://localhost:3306/demo", user, pass);
// Creating statement
myStmt = myConn.createStatement();
// Executing SQL query
myRs = myStmt.executeQuery("SELECT last_name, first_name FROM employees");
// Processing the result set
StringBuilder data = new StringBuilder();
while (myRs.next()){
String lastName = myRs.getString("last_name");
String firstName = myRs.getString("first_name");
data.append(lastName).append(",").append(firstName).append("
");
System.out.println(lastName +","+ firstName);
}
// Displaying data in JavaFX
Text text1= new Text();
text1.setText(data.toString());
VBox root = new VBox();
root.getChildren().addAll(text1);
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;");
the picture I have is the error I get, Can anyone please explain how this is possible? I am using netbeans and I have all have javafx jar files in my library for the project.
 I do not know what to do. I have this error

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!