There is a problem in my application......................

The following code is a Login Class code that I mentioned Earlier thanks for guiding me through but the problem is this that the code wouldn't go on after the isUser() method in this code.
(Remember I use JBuilder 3.5 Professional for building Java Applications.)
Please Help me out with this application...
package dailyExpense;
import java.io.*;
import java.io.Serializable;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class LoginExpense extends JFrame {
  JLabel LoginLbl = new JLabel();
  //Panels
  JPanel contentPane = (JPanel)this.getContentPane();
  JPanel User = new JPanel();
  JPanel btnPane = new JPanel();
  //Other things
  JLabel usrNmeLbl = new JLabel();
  JTextField userName = new JTextField();
  JLabel pasLbl = new JLabel();
  TextField passWord = new TextField(18);
  UIManager.LookAndFeelInfo looks[];
  JButton newUsrbtn = new JButton();
  JButton lgnbtn = new JButton();
  //File
  RandomAccessFile out;
  File f = new File("C:/Program Files/Expense.usr");//File Name
   public LoginExpense() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
      jbInit();
    catch(Exception e) {
      e.printStackTrace();
  private void jbInit() throws Exception {
    looks = UIManager.getInstalledLookAndFeels();
    contentPane.setLayout(new BorderLayout());
    LoginLbl.setFont(new java.awt.Font("Serif", 1, 25));
    LoginLbl.setForeground(Color.red);
    LoginLbl.setHorizontalAlignment(SwingConstants.CENTER);
    LoginLbl.setHorizontalTextPosition(SwingConstants.CENTER);
    LoginLbl.setText("LOGIN");
    usrNmeLbl.setText("User Name: ");
    userName.setPreferredSize(new Dimension(150, 21));
    User.setPreferredSize(new Dimension(210, 31));
    pasLbl.setMaximumSize(new Dimension(80, 17));
    pasLbl.setPreferredSize(new Dimension(70, 17));
    pasLbl.setText("Password: ");
    passWord.setEchoChar('*');
    this.setDefaultCloseOperation(3);
    this.setResizable(false);
    this.setTitle("Daily Expenses [LOGIN]");
    newUsrbtn.setFont(new java.awt.Font("Dialog", 1, 15));
    newUsrbtn.setText("New User");
    newUsrbtn.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(ActionEvent e) {
        newUser(e);
    //lgnbtn
    lgnbtn.setFont(new java.awt.Font("Dialog", 1, 15));
    lgnbtn.setPreferredSize(new Dimension(103, 31));
    lgnbtn.setText("LOGIN");
    lgnbtn.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(ActionEvent e) {
        usrlgn(e);
    //Add all things on the Panel
    btnPane.setPreferredSize(new Dimension(207, 41));
    contentPane.add(LoginLbl, BorderLayout.NORTH);
    User.add(usrNmeLbl, null);
    User.add(userName, null);
    User.add(pasLbl, null);
    User.add(passWord, null);
    contentPane.add(User, BorderLayout.CENTER);
    btnPane.add(newUsrbtn, null);
    btnPane.add(lgnbtn, null);
    contentPane.add(btnPane, BorderLayout.SOUTH);
    UIManager.setLookAndFeel(looks[2].getClassName());
     SwingUtilities.updateComponentTreeUI(this);
//Open File
private void OpenFile(){
    try{
    out = new RandomAccessFile(f, "rw");//Open File in Read Write Mode
  catch(IOException e){e.printStackTrace();}
//Open File in ReadOnly
private void OpenReadOnly(){
    try{
    out = new RandomAccessFile(f, "r");//Open File in Read Mode
  catch(IOException e){e.printStackTrace();}
//Close File
public void CloseFile(){
  try{
    if (out != null)
      out.close();
  catch(IOException e){e.printStackTrace();}
public void addRecord(){
  if (!(userName.getText() == "")){
    UserRecord urec = new UserRecord(userName.getText(), passWord.getText());
   try{
      out.seek(f.length()+1);
      urec.write(out);
    catch(IOException e){e.printStackTrace();}
    finally{
      CloseFile();
  else
    JOptionPane.showMessageDialog(this,"Please enter User Name", "Incomplete",
    JOptionPane.ERROR_MESSAGE);
public boolean isUser(User us){
boolean flag = true;
UserRecord usr = new UserRecord("","");
UserRecord ck = new UserRecord(us.getUserName(), us.getPwd());
try{
  do{
    OpenReadOnly();
    usr.read(out);}
    while(usr.getUserName() == "");
    if (usr.getUserName() == ck.getUserName() &&
                usr.getPwd() == ck.getPwd())
          flag = true;
    else
          flag = false;
          CloseFile();
    catch(EOFException e){e.printStackTrace();
    CloseFile();
    catch(IOException e){e.printStackTrace();}
    return flag;
void newUser(ActionEvent e) {
  OpenFile();
  addRecord();
  CloseFile();
   void usrlgn(ActionEvent e) {
     Expense expense = new Expense();
   UserRecord u = new UserRecord (userName.getText(), passWord.getText());
   if(isUser(u)){
      expense.setVisible(true);
      this.setVisible(false);
public static void main(String[] args) {
    LoginExpense login = new LoginExpense();
    Expense expense = new Expense();
    login.setSize(new Dimension(250, 200));
    login.setVisible(true);
    expense.setSize(new Dimension(600, 250));
    expense.setVisible(false);
class User implements Serializable{
  private String UserName;
  private String Password;
public User(String usr, String pwd){
  UserName = usr;
  Password = pwd;
  public User(){
public User(User usr){
  this.UserName = usr.UserName;
  this.setPassWord(usr.Password);
  public void setUserName(String name){
    this.UserName = name;
  public String getUserName(){
    return UserName;
  public String getPwd(){
    return Password;
  public void setPassWord(String pwd){
    Password = pwd;
  public boolean equalto(User usr){
   if(this.UserName.equals(usr.UserName))
    return true;
    else return false;
class UserRecord extends User{
public UserRecord(String UserName, String Pwd){
   super(UserName, Pwd);
private String padName(RandomAccessFile file) throws IOException{
  char name[], temp;
  name = new char[15];
   for(int i=2; i<name.length; i++){
     temp=file.readChar();
     name[i] = temp;
return new String(name).replace('\0',' ');
private void writeString(RandomAccessFile file, String txt)
throws IOException{
StringBuffer buf = null;
if (txt!=null)
   buf = new StringBuffer(txt);
else
   buf = new StringBuffer(15);
  buf.setLength(15);
  file.writeChars(buf.toString());
public void read(RandomAccessFile file)throws IOException{
   setUserName(padName(file));
   setPassWord(padName(file));
public void write(RandomAccessFile file)throws IOException{
  writeString(file, getUserName());
  writeString(file, getPwd());
public static int size(){
   return 65;
}Help me out with this

Well Basically nothing happens.
The code just will not execute the following portion
public boolean isUser(User us){
boolean flag = true;
UserRecord usr = new UserRecord("","");
UserRecord ck = new UserRecord(us.getUserName(), us.getPwd());
try{
  do{
    OpenReadOnly();
    usr.read(out);}
    while(usr.getUserName() == "");
    if (usr.getUserName() == ck.getUserName() &&
                usr.getPwd() == ck.getPwd())
          flag = true;
    else
          flag = false;
          CloseFile();
    catch(EOFException e){e.printStackTrace();
    CloseFile();
    catch(IOException e){e.printStackTrace();}
    return flag;
  }I am calling it when the User presses the Login button as follows
void usrlgn(ActionEvent e) {
     Expense expense = new Expense();
   UserRecord u = new UserRecord (userName.getText(), passWord.getText());
   if(isUser(u)){
      expense.setVisible(true);
      this.setVisible(false);
  }Now is it easier............?????????????????????????????????

Similar Messages

  • When I try to open contacts from the icloud control panel on my windows 7 PC, I get an error message: can't load contacts. There was a problem loading the application.

    When I try to open contacts from the icloud control panel on my windows 7 PC, I get an error message: can't load contacts. There was a problem loading the application.

  • There was a problem loading the application

    I find that I can log into iCloud with no problem but after, that every time I try to open an app I get the message
    "there was a problem loading the application"
    I'm using Safari 7.0.5
    This has been going on for quite some time and during that period I've read many threads and followed various trouble shooting guides but I can't solve it. I really would appreciate any suggestions that you might care to offer.

    Downloading Safari 5.1.7 will work, or at least that's how I now access iCloud and run the Apps. IE9 64-bit will also work. On my system it appears that IE9 32-bit has a problem with iCloud due to Norton Internet Security. When Norton's "Browser Protection" is disabled, IE9 32-bit works for me.
    With Safari, I set its Homepage to iCloud so I'd have a direct link to the iCloud website.

  • HT204053 Hi all, I am constantly running into problems opening iCloud services (mail, calendars, iWork's, etc.). I get a message stating i.e. Can't load Mail (Calendar, iWork), There was a problem loading the application. Does anybody know what a heck is

    Hi all, I am constantly running into problems opening iCloud services (mail, calendars, iWork's, etc.). I get a message stating i.e. Can't load Mail (Calendar, iWork), There was a problem loading the application. Does anybody know what a heck is going on?

        I can see that this issue has been quite extensive, and frustrating, and I am so sorry for all that has happened societygirl! I would like to help you work this issue out. Please follow & send me a Direct Message, so I can get your account specifics and help finally bring this to a resolution.
    Thank you,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

  • TS3376 I was able to use the findmyiphone app last week, but now I have been getting an error message "Can't load findmyiphone.  There was a problem loading the application."  please help as we are trying to locate an ipod with pics of a no deceased loved

    I was able to use the findmyiphone app last week, but now I have been getting an error message "Can't load findmyiphone.  There was a problem loading the application."  please help as we are trying to locate an ipod with pics of a no deceased loved one.

    Had the same problem and the same message --  was suddenly unable to access icloud apps on my pc, also using Windows 7 and Internet Explorer. After several days of pulling my hair out, decided to try a different browser and was able to get in by using Firefox instead of Internet Explorer.  Hope this helps. 

  • HT1338 I can;t open my iCloud account, the message I get is: there was a problem loading the application

    Hi, After login into my iCliud account and click on any of the application to open, this is the message I get: there was a problem loading the application.
    please kindly help.
    John Awe

    . nice one.. it only because my date was wrong.. thank you so much for the links.

  • ICloud on an iMac is unable to load mail. Message " Can't load mail. There was a problem loading the application. )

    I can not access my mail on my desktop. The problem is persistant and the only message I get is " Can't load mail. There was a problem loading the application. )

  • Can't Load Mail - There was a problem loading the application

    I can't access mail on iCloud after signing, and get this error message:
    Can't Load Mail
    There was a problem loading the application
    I can see that there are five emails waiting for me.
    Any thoughts on what's going wrong, please?

    Open System Preferences > iCloud
    Deselect the box next to Mail then reselect it.
    Then try accessing your mail.
    It may take a minute or two for iCloud to re sync the data.

  • When i go to the icloud page and click find my phone, i get a box that says "can't load find my iphone.  There was a problem loading the application".  What do I do now?  Thank you

    When i go to the Icloud page and i click on find my Iphone, I get a message that says "Can't load Find my Iphone. There was a problem loading the application." What do I do now.  Thank you

    Mail has been down all morning. Pacific time. California here.
    Since 7am PST - it's 11:36 am right now. still down.
    It's a routine maintenance issue I was told. - but very frustrating not to know ahead of time.

  • ""selected font failed during last operation." and " there is a problem with generator" application error

    For PSDs I have created in older versions of Photoshop CC 2014 I am getting errors when opening / trying to save. They seem to be either Generator or font related. Interestingly, PSDs created in newer versions of PS CC 2014 have no issues, even when using same fonts.
    I am getting the error messages:
    When I open the older PSD files, (again created or saved in older versions of PS CC 2014) I am asked to update fonts. If I do I get the error.
    'Selected font failed during last operation'
    When I try to don't try to update fonts and then I try to play with the file I get the following error.
    'There is a problem with Generator. Please quit Photoshop and try again. If the problem persists, remove any third-party plugins or try re-installing photoshop.
    I don't have any third party plugins that I can see.
    I have re-installed multiple times.
    I need to use this program and I am paying for your services. I am actually on the phone now with 'help desk' and have been on hold for 22 minutes.
    Please Help

    When I installed the Apple programs, mobile device application did not uninstall by itself. I had to go to c://program files/common files/apple/mobile device application (or something like that) and manually delete the contents and the folders. I have a 64 bit version so I also had to visit c://program files (x86)/common files/apple/mobile application device (or similar) and also manually delete the files and folders. I had to delete the files before I could delete the folders. This manual part is probably tripping everyone up, because it's not as easy as simply hitting uninstall in the control panel. But the instructions are there. I hope this helps you.

  • Uninstalled itunes and tried to reinstall and the program gets to the services part and then tells me there is a problem with mobile application

    uninstalled itunes and when trying to re-install i get an error messages during the starting services part

    When I installed the Apple programs, mobile device application did not uninstall by itself. I had to go to c://program files/common files/apple/mobile device application (or something like that) and manually delete the contents and the folders. I have a 64 bit version so I also had to visit c://program files (x86)/common files/apple/mobile application device (or similar) and also manually delete the files and folders. I had to delete the files before I could delete the folders. This manual part is probably tripping everyone up, because it's not as easy as simply hitting uninstall in the control panel. But the instructions are there. I hope this helps you.

  • I used to get all my emails no problem. Now I get a "Can't Load Mail ... there is a problem with the application error. I have reported it many times but zero response from Apple

    help plz

    Hello,
    Thank you for visiting Apple Support Communities.
    Here are a couple troubleshooting resources I would recommend when experiencing issues with iCloud Mail.
    iCloud: Troubleshooting iCloud Mail
    http://support.apple.com/kb/TS4002
    iCloud: Account troubleshooting
    http://support.apple.com/kb/TS3988
    If all steps have been processed, see the section labeled Additional Information in the first article.
    Cheers,
    Jason H.

  • Problem installing Java Applications

    Hi there, i have problems installing Java Applications (from Ovi and from another source). The Apps from stores quit with just "there was a error", the other App is more detailed:
    Interner Fehler: Jsr plugin com.nokia.mj.impl.chapi.core.utils.
    ServiceProviderInstaller cancelled installation
    Is it possible that the Java-Handler is missing or faulty? Can this handler be manually installed? Thanks Gerd (E7-00 Anna, clean installation after hardreset)
    Solved!
    Go to Solution.

    Sorry about my previous answer, as it's not really an efficient solution.
    Skyee put the solution for this issue in another thread
    FA136376 I am unable to install any Java apps after the Symbian Anna upgrade, how to fix this?
    After upgrading Symbian Anna and starting the Java installation file on the Nokia Symbian^3 device, the following error message may be displayed: Installation failed – internal error: Jsr plugin com.nokia.mj.jmpl.chapi.core.utils.ServiceProviderInstaller cancelled installation. To fix this, install the following java_symbian_anna_fix.sis file: http://dl.nokia.com/ns/java_symbian_anna_fix.sis .
    Note: During the installation the file will give the warning message: Application not compatible with phone. Continue anyway. Select yes to proceed.

  • HT1926 I updated the Itunes on my computer and it begin having problems. I tryed a new installation and there is a message saying an application has made an attempt to load C runtime library incorrectly. What shoul I do?

    I updated the Itunes on my computer and it begin having problems. I tryed a new installation and there is a message saying an application has made an attempt to load C runtime library incorrectly. What shoul I do?

    Hello rvalle3,
    The following article can help get iTunes updated and running again.
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    Allen

  • When i click on an excel or word file in 2007 the program begins to open but then an error message says There was a problem sending the command to the program

    when i click on an excel or word file in 2007 the program begins to open but then an error message says There was a problem sending the command to the program.
    i am using office2007  with windows7 premium home edition.  i have checked file associations., all DDE settings. i have even tried this in safe mode. the same thing happens. please note once i see the error. i can then go back to the file click on
    it a second time and it WILL open. AND i can open any file if i open excel and and find the file from there. i uninstalled and re-installed office 2007 from scratch. And i checked the compatibility mode (all un-checked) still the problem persisits. this is
    a real PITA.   anyone have any solution for this? Thanks 
    ken yanow

    Hi,
    Have you try to un-select the Ignore other applications that use Dynamic Data Exchange (DDE) setting?
    Click the Microsoft Office Button, and then click Excel Options.
    Click Advanced, and then click to clear the Ignore other applications that use Dynamic Data Exchange (DDE)
    check box in the General area.
    Click OK.
    If the problem cannot resolve, the Run as administrator may selected.
    Go to Office default install location: C:\Program Files\Microsoft Office\Office12.
    Right-click EXCEL.EXE > Properties >
    Compatibility tab.
    Under Privilege Level, uncheck Run this program as an administrator
    check box.
    Best regards.
    William Zhou
    TechNet Community Support

Maybe you are looking for

  • [Sol 10 11/06 SPARC on Sun Blade 2500] Could not determine boot disk?

    dear all, I have a problem during installation of Solaris 10 11/06 Sparc on Sun Blade 2500. After I choosing "Initial Install" at "Select Upgrade or Initial Install" stage, appears the following error message : "Note : Default install is not possible

  • Jerky scrolling on mobile devices with Muse website

    We have just built and published our first website on all three platforms (desktop, tablet and phone) but the vertical scrolling on the Phone and Tablet pages is jerky, and struggles to render the text smoothly compared to other websites when scrolli

  • Cannot remove lost mode when found findmyiphone

    Hello, I've had a good look online but cannot find anything that helps free up my phone. Phone was stolen, I located it using findmyiphone and put it into lost mode. After going to the address it was located at and getting denial (and all surrounding

  • Edited vector Smart Objects update pixilated in Photoshop

    Hello everyone, hope you can help. I import CS3 Illustrator vector EPSs as smart objects into PSDs which works fine... until I need to edit the smart object. I follow the prompts on screen and double click on the smart object which opens an Illustrat

  • Replacement for DEC datatype

    Hi Experts, I have encountered a problem in an upgrade project. Can anybody tell me what is the replacement for DEC decimal data type in the new system?