• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP!!!! verifying userID & Password from Applette

ione walker
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been given an assinment by a Java teacher
to create a banking application where the first
screen will be the welcome to the program,
User Input of UserID & Password.
& an Submit & Cancel Button.
Once the Submit button is pressed the program
meeds to pull the UserID & Paswd from the
screen & compare it to information comtained
in a file.
If Ok go on to the next screen & iff not
refresh the screen & try again.
So far I have an ugly BUT working applet.
How the heck do I take the userid/pswd
& compair it to a file?

import javax.swing.JOptionPane;
import javax.swing.JDialog;
import javax.swing.JButton;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.BoxLayout;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
import javax.swing.JTabbedPane;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.beans.*; //Property change stuff
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*; //for layout managers
import java.awt.event.*; //for action and window events
import java.net.URL;
import java.io.IOException;
public class BankingDemo extends JApplet //implements ActionListener
public void init()
Container contentPane = getContentPane();
contentPane.setLayout(new GridLayout( 6, 1 ));
//define the text labels
JLabel welcomelabel1 = new JLabel( "Welcome to Banking Application" );
welcomelabel1.setFont(new Font("Helvetica", Font.BOLD, 20));
JLabel welcomelabel2 = new JLabel( "Please Enter UserID (ione) & Password (ione)" );
JTextField mytf1 = new JTextField( "Enter your used ID here (ione)" );
JPasswordField mytf2 = new JPasswordField( "Write you Password here" );
JButton buttonSubmit = new JButton( " Submit " );
JButton buttonCancel = new JButton( " Cancel " );
contentPane.add(welcomelabel1);// display Welcome Label
contentPane.add(welcomelabel2);// display Welcome Label
contentPane.add(mytf1);// display userID field
contentPane.add(mytf2);// display passowrd field pane
contentPane.add(buttonSubmit);// display Submit button
contentPane.add(buttonCancel);// display Cancel button

Ione Walker
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ione,
Your problems will be much worse. You need to create an APPLICATION not an Applet to get the job done. An Applet has security restrictions that prevent it from performing I/O.
Before you try and overcome them, find out if an application will suffice.
If it can then you can use a cardLayout to hold the screens and only show the first card until the validation is passed.
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is an Applette a french Applet? Or maybe a baby Applet?
Sorry, you can use a Dialog or a JDialog to get input from your user. You will want to use a JPassword field also.
Where exactly is the file that you are going to compare to supposed to be kept? Normally that would be on a remote machine, requiring a URL connection.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic