Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.util.Scanner;
- public class TEST {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String username = JOptionPane.showInputDialog("Username");
- String password = JOptionPane.showInputDialog("Password");
- if (
- username != null &&
- password != null &&
- ((username.equals("svetlyo") &&
- password.equals("password") ||
- (username.equals("test")
- && password.equals("test"))
- ))
- ) {
- JOptionPane.showMessageDialog(null, "You are in");
- } else {
- JOptionPane.showMessageDialog(null, "Wrong");
- }
- }
- }
Add Comment
Please, Sign In to add comment