Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- public class frame{
- public static void main(String[] args){
- String username= "marko";
- String password ="12345";
- JFrame frame= new JFrame("registration");
- ImageIcon icon = new ImageIcon("C:/Users/mars/Desktop/reddit.png");
- frame.setIconImage(icon.getImage());
- JTextField[] fields= {new JTextField(), new JTextField()};
- Object[] surface = {"Username", fields[0], "password", field[1]};
- int click= JOptionPane.showConfirmDialog(frame,surface, "Reddit
- registration",2,2,icon);
- String eusername= fields[0].getText();
- String epassword= fields[1].getText();
- if ((click == 0) & (username==eusername) & (password==epassword))
- {
- JOptionPane.showMessageDialog(null,"Thank you very
- much","registration",2,icon);
- }
- else
- {
- JOptionPane.showMessageDialog(null,"Please try again",
- "entry","registration",2,icon);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement