• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HELP!!!! verifying userID & Password from Applette

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

HELP!!!
=======
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
walkeri@usa.net
========================
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
Regards,
Manfred.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic