So I wrote a method that makes the user enter a password and this password must pass the following specs:
1. Be at least 8 digits long
2. Have an uppercase
3. Have a lowercase
4. Have special digit
I'm not sure as to why when I input it, the output doesn't account for the special Character and throws an error.
Here is my code so far:
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Please enter …Run Code Online (Sandbox Code Playgroud) 我在 javaFX 中编写了代码来打开一个文本文件,我的代码打开了它,但它没有显示文本文件中的任何内容。而且只是为了好玩,我想知道编辑文本文件然后使用用户刚刚所做的编辑保存文本文件的最佳方法是什么。任何提示将非常感谢。
这是我的代码:
package blah;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.stage.FileChooser;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;
import javafx.scene.control.Button;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import java.io.File;
public class blah
extends Application {
private Text actionStatus;
private Stage savedStage;
public static void main(String [] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
Button open = new Button("open");
open.setOnAction(new SingleFcButtonListener());
HBox open1 = new HBox(10);
open1.getChildren().addAll(open);
Button save = new Button("Save");
HBox save1 = new HBox(10);
save1.getChildren().addAll(save);
actionStatus …Run Code Online (Sandbox Code Playgroud)