最简单的界面代码分享,小白,写的不好哈哈
package com.yjxxt.test;
import javax.swing.*;
import java.util.Scanner;
public class Login {
public static void main(String[] args) {
String a = "哈哈";
int bb = 1234;
System.out.println("用户名:");
Scanner sc = new Scanner(System.in);
String name = sc.nextLine();
System.out.println("密码:");
int miMa = sc.nextInt();
if (a.equals(name)&&bb==miMa){
System.out.println("登录成功");
}else
System.out.println("用户名或密码输入有误");
/*System.out.println("用户名或密码输入有误");
}else if(miMa!=bb){
System.out.println("用户名或密码输入有误");
}else
System.out.println("登录成功");*/
}
}