Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 moduleinfo.java file and it doesn't like when I try to make the moduleinfo.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.sqlConnection;
import java.sqlDriverManager;
import java.sqlResultSet;
import java.sqlSQLException;
import java.sqlStatement;
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 startStage stage
Scanner input new ScannerSystemin;
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.getConnectionjdbc:mysql:localhost:demo user, pass;
Creating statement
myStmt myConn.createStatement;
Executing SQL query
myRs myStmtexecuteQuerySELECT lastname, firstname FROM employees";
Processing the result set
StringBuilder data new StringBuilder;
while myRsnext
String lastName myRsgetStringlastname";
String firstName myRsgetStringfirstname";
data.appendlastNameappendappendfirstNameappend
;
System.out.printlnlastName firstName;
Displaying data in JavaFX
Text text new Text;
textsetTextdatatoString;
VBox root new VBox;
root.getChildrenaddAlltext;
root.setSpacing;
root.setStylefxpadding: ;
fxborderstyle: solid inside;"
fxborderwidth: ;
fxborderinsets: ;
fxborderradius: ;
fxbordercolor: 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started