Question: JavaFX random String(?) generator? Here are the instructions Here is the code that I have started, MAIN.JAVA import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene;
JavaFX random String(?) generator?
Here are the instructions

Here is the code that I have started,
MAIN.JAVA
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public static void main(String[] args){
launch(args);
}
public void start(Stage primaryStage) throws Exception{
Label label = new Label(StringResource.PASSWORD_MESSAGE);
label.setFont(new Font(/*insert a font*/));
grid.add(label, 0, 1);
TextField textField = new TextField(Password.genRandomNum(8));
textField.setFont(new Font(/*insert a font*/));
grid.add(textField,1,1);
Button button = new Button();
button.setText(StringResource.BTN_PASSWORD_REFRESH);
button.setOnAction(ActionEvent ->{
String newPassword = Password.genRandomNum(8);
System.out.println(StringResource.PASSWORD_MESSAGE + newPassword);
textField.setText(newPassword);
}
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Password Generator");
primaryStage.setScene(new Scene(root, 500, 275));
primaryStage.show();
}
}
PASSWORD.JAVA
import javafx.fxml.FXML;
import javafx.event.ActionEvent;
import javafx.scene.control.TextField;
import javafx.scene.text.Text;
import java.util.Random;
public class Password{
public TextField lengthField;
public TextField specialChar;
public TextField numChar;
public TextField lengthResult;
private static final String symbols = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$&@?~!%#";
public static String randomString(Random r){
while
}
}
The goal of this project is to create a GUI program that generates random passwords for the user. The program should consist of the following JavaFX components: . 1 Button to create a password 3 RadioButtons to allow the user to select only one size for the password in characters (8, 16, 32). By default 8 should be selected 3 CheckBoxes to allow the user to select a level of complexity for the password ("Use Caps', "Use Special Characters", "Use Numbers"). By default the password would consist only of lowercase letters e 1 TextField to display the created password The look of the application is up to you.You goal should be along the lines of functional and ergonomic. When the create password button is clicked by the user the program should generate a password of random characters with a length equal to the value chosen by the radio buttons. The password should consist only of lower case characters (a-z) unless the user has checked any of the various checkboxes to make the password more complex by including capital letters, numbers, or special characters: $ !@#$%&
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
