Very simple app, why am I getting errors?

1: I can't figure out why the button doesn't work. I just want it to update the JTextField so I know it's registered a click.
2: I run this program using "java Login" on the command line. The errors scroll by and I can't even see what they are. Is there some way to capture the errors?
//     Login - a simple java class for logging in to applets
/*     doc goes here
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class Login extends JFrame implements ActionListener
{     JPanel                northPanel;
     JTextField     fldLogin;
     JTextField     fldPassword;
     JPanel               southPanel;
     JButton               btnSubmit;
     JButton               btnCancel;
     public Login()
     {     northPanel = new JPanel();
          northPanel.setLayout(new GridLayout(2,2));
          northPanel.add(new JLabel(" Login: "));
          northPanel.add(new JTextField(20));
          northPanel.add(new JLabel(" Password: "));
          northPanel.add(new JTextField(20));
          southPanel = new JPanel();
          btnSubmit = new JButton("Submit");
          btnSubmit.setActionCommand("Submit");
          btnSubmit.addActionListener(this);
          btnCancel = new JButton("Cancel");
          btnCancel.setActionCommand("Cancel");
          btnCancel.addActionListener(this);
          southPanel.add(btnSubmit);
          southPanel.add(btnCancel);
          getContentPane().setLayout(new BorderLayout());
          getContentPane().add("North",northPanel);
          getContentPane().add("South",southPanel);
          //setSize(200,100);
          addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){System.exit(0);}});
     public void clearLogin()
     {     fldLogin.setText("");
     public void actionPerformed(ActionEvent e)
     {     if (e.getActionCommand() == "Submit")
          {     //do nothing
               //fldLogin.setText("1");
               clearLogin();
          if (e.getActionCommand() == "Cancel");
          {     //System.exit(0);
               //fldPassword.setText("2");
     public static void main(String args[])
     {     Login thisLogin = new Login();
          thisLogin.pack();
          thisLogin.setLocation(100,100);
          thisLogin.show();
}

JTextField     fldLogin;not instiated
public void clearLogin()
{     fldLogin.setText("");above will throw
{     if (e.getActionCommand() == "Submit")change == to equalsIgnoreCase
if (e.getActionCommand() == "Cancel");change == to equalsIgnoreCase
and remove the trailing ';'
and use else if

Similar Messages

  • When try to download apps from ipod keep getting error 1004, change password 2 days ago dont know if that why problem occur can someone help

    When try ti down load apps from Ipod keep getting error 1004 how can I download ?

    http://support.apple.com/kb/TS3694#error1004
    There have been some problems accessing pages on the Apple web site.  If the hyperlink gives you a "We're sorry" message, try again.

  • Why do I get error 150:30 when I try and send a photo to Elements 8?

    Why do I  get error 150:30 when I try and send a photo to Elements 8 from a PC with windows8?

    My wife had this problem for the past few days for a specific phone number. These instructions fixed it -- without having to restore from backup or contact the carrier.
    http://www.timothydeblock.com/blog/2014/5/12/fix-message-sent-using-invalid-numb er-of-digits-msg-2114
    Open Contacts -> select the contact -> select edit -> scroll all the way to the bottom and delete contact (delete multiple entries of the same phone number, my wife had five).
    Open the Messages app -> select Edit -> select the red circle and then select delete. Do this for both the person and the messages you received.
    Open the Settings app -> scroll down and select Messages -> turn off messages, by selecting the switch, and any other options turned on.
    Turn off your phone and then turn it back on.
    Go straight to messages and compose a new message and put in the phone number of the person you're trying to text. Send and that person should receive the text message. Add the person to your contacts and go back into message settings to turn on any other options you want on that you turned off.
    John

  • Why do I get "Error 1 occured at Config Data Registry.vi(get data) invalid object 0" while starting my application?

    Why do I get "Error 1 occured at Config Data Registry.vi(get data) invalid object 0" when starting my application created in LabVIEW 7.1?  I am starting the application in a PXI rack running Windows XP.  I have an executable written in LabVIEW 7.0 that runs without this error.  After clicking the Continue button in the error, the application seems to continue happily.
    Is there something I need to include when I make the executable?
    I would like to understand and eliminate this start up error.
    Thanks in advance.
    BobNorth

    Hi Bob,
    I looked through the program and I figured out where the error is coming from, and potentially what is causing it. In a lot of the cases of the program you are searching a 1-D array for the name of the case, and if you don't find it then it skips the function and gives "Error 1 occurred at Config Data Registry.vi(CASENAME) invalid object 0". I attached a screenshot that shows what I mean. The Search 1-D Array.vi is returning a -1 which means it didn't find the case. The reason I believe this is happening is because the shift register for that array is not initialized. While the other cases "reset" and "register" interact with the array shift registers and most likely create the array you need, if the program defaults to the "get data" case then it will try to run that before registering and won't have an array to search. This would also explain why it only has this problem at first and seems to run just fine after that. To fix this you should either make an initial array and wire it into the shift register or make the "reset" case the default as opposed to the "get data" case.
    Regards,
    Peter W.
    Attachments:
    Config Data Registry.png ‏55 KB

  • Why am I getting error code 1402 when trying to update adobe reader 10?

    Why am I getting error code 1402 when trying to update adobe reader 10?

    Impossible to guess the "why" with so little information, but this may be helpful if you want to solve the problem: Error 1402 | Error 1406 | Acrobat, Reader

  • Why do I get error dw040 ?

    why do i get error dw040 ?

    Please provide us with the following logs.
    You can find them at:
    PS Installer logs
    For Mac:
    Library\Logs\Adobe\Installer
    For Win:
    Program Files(x86)\Common Files\Adobe\Installers
    You can zip all the files together and send us through mail. This would help us in finding the root cause.
    Appreciate your help. Apologize for the inconvenience.
    Regards,
    Ashutosh
    [email protected]

  • Why do i get  error code -3212

    why do i get  error code -3212

    Have you looked at the previous discussions listed on the right side of this page under the heading "More Like This"?

  • Why do I get error OxE800000A

    why do I get error Oxe800000A or E0000225 when i try to hook up my iphone4 to itunes

    There are troubleshooting steps for 0xE errors here: http://support.apple.com/kb/TS3221.

  • Why do I get Error 32812?

    I wrote a VI, which worked perfectly.
    After addressing the cFP from the network instead of from the PC, some Read tags gave Error 32812.
    For one of them I deleted them and wrote them again, and the error was recovered. But then it appeared for another module.
    From MAX I can perfectly read the channels. I also tried to "find items" again.
    What could be the reason and the cure?
    thanks
    Francesca

    Dear Francesca,
    quite a few documents exist on your problem.
    I'd start checking into them.
    You can use the keyword 32812in the "seach"  field in www.ni.com and find 
    Why Do I Get Error -32812 When I Read or Write to a cFP-180x from a cFP-2xxx?
    http://digital.ni.com/public.nsf/allkb/80A4EF3A7A1784D6862573F4000B20C5
    Why Do I Get Error 32812 From Some FieldPoint Modules But Not Others?
    http://digital.ni.com/public.nsf/allkb/9DB72AFCBC02D7D986256FC10055D65B
    Error 32812 From FieldPoint VIs
    http://digital.ni.com/public.nsf/allkb/02EB73D02715981A8625682B00774F8F
    Best regards  
    FiloP
    It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
    Richard P. Feynman

  • TS3694 Why am I getting error code 3194 when i try to restore my ipod?

    Why am I getting error code 3194 when I try to restore my ipod touch 4th generation

    This device is not eligible for the requested build: Also sometimes displayed as an "error 3194." If you receive this alert, update to the latest version of iTunes. Third-party security software or router security settings can also cause this issue. To resolve this, follow Troubleshooting security software issues.
    Downgrading to a previous version of iOS is not supported. If you have installed software to perform unauthorized modifications to your iOS device, that software may have redirected connections to the update server (gs.apple.com) within the Hosts file. First you must uninstall the unauthorized modification software from the computer, then edit out the "gs.apple.com" redirect from the hosts file, and then restart the computer for the host file changes to take affect.  For steps to edit the Hosts file and allow iTunes to communicate with the update server, see iTunes: Troubleshooting iTunes Store on your computer, iPhone, iPad, or iPod—follow steps under the heading Blocked by configuration (Mac OS X / Windows) > Rebuild network information > The hosts file may also be blocking the iTunes Store. If you do not uninstall the unauthorized modification software prior to editing the hosts file, that software may automatically modify the hosts file again on restart. Also, using an older or modified .ipsw file can cause this issue. Try moving the current .ipsw file, or try restoring in a new user to ensure that iTunes downloads a new .ipsw.
    Error 3194: Resolve error 3194 by updating to the latest version of iTunes. "This device is not eligible for the requested build" in the updater logs confirms this is the root of the issue. For more Error 3194 steps see: This device is not eligible for the requested build above.
    http://support.apple.com/kb/TS3694#error3194
    Also see:
    iPhone Error 3194 - How to Fix iTunes Error 3194?

  • Trying to update apps on iphone and getting error message, there is not enough available local storage to download these items. you can manage your local device storage usage in settings

    trying to update apps on iphone and getting error message, there is not enough available local storage to download these items. you can manage your local device storage usage in settings. What am I to do?

    The storage you purchased is in the cloud, and doesn't do anything with your pad.  Your problem is simply that you have too much content on your pad.   Go to settings, general, usage, and it will show you how much space you have avaliable on your pad.  If you let the screen sit for a while, all the apps will be displayed, and you can see how much stuff you have associated with each.
    You have to no option but to delete some of the content on your pad.  Videos, comics, pitcures and some music files use a lot of space.   The cloud allows you to leave stuff there, so you can get it when you need it.

  • I got my iphone4 yesterday and when I try to get any apps from apps store I keep getting error 1004 please try later please help th iPhone is brand new!

    I got my iphone4 yesterday and when I try to get any apps from apps store I keep getting error 1004 please try later please help th iPhone is brand new!

    mandyfromhull wrote:
    I got my iphone4 yesterday and when I try to get any apps from apps store I keep getting error 1004 please try later please help th iPhone is brand new!
    Try this link to fix your problem.
    http://forums.macrumors.com/showthread.php?t=949246

  • Why am i getting error 150;30 when i click on edit

    Why am i getting error code 150:30 when I click on edit in Photoshop Elements 8. Says my licencing has stopped working.

    Exactly, and if using IE the error code doesn't appear and the media with play straight away, so it does seem to be directly related to Firefox...

  • TS1538 Why am i getting error 9006 when trying to restore my ipod 5th gen?

    Why am i getting error 9006 when trying to restore my ipod 5th generation?

    Configure your security software
    Check your security software and settings, which can block ports and prevent connection to Apple servers during update and restore.
    Common errors: 2, 4, 6, 9, 1000, 1611, 9006, 9807, 9844. Sometimes as a result of this issue, a device might stop responding during the restore process.

  • Why am i getting error 5002 when trying to redeem a UV movie purchase?

    Why am i getting error 5002 when trying to redeem a UV movie purchase?

    Sharonc21 wrote:
    If one is downloading directly to the iPhone via WiFi, it doesn't matter what version of iTunes is on the computer.
    I decided to sync my phone to Outlook via iTunes.  First thing, iTunes discovered that 7.0.3 was not on my phone.  It asked if i wanted to install it.  I said, "yes", and VOILA!! 7.0.3 is now installed on my iPhone.
    So therein is the answer.  Have no idea what bug is in there to keep it from loading to some phones directly via WiFi, but obviously, it is something!!
    There is no bug.  While you can update your iOS via wi-fi, it's recommended to do so via USB & iTunes.  Depending on your wi-fi connection & singal strength, you can get errors.  That's not a function specifically of the device.

Maybe you are looking for

  • How to create entity for the table which is not having the primary key

    Hi, Is it possible to create an entity for the table which is not having the primary key. I have to write a method in my session bean and that method must use this entity. any websites for this.

  • Error when installing update for desktop software

    when i try to update my software i am getting the error message saying  Blackberry Destiop Software requires that Microsoft Visual C++ 2008 SP1 RAedistributable package is installed . Can some one please help me 

  • CIsco ISE - HP Openview monitoring.

    Hi guys, I have a doubt about monitoring Cisco ISE services in the network. We can send some alarms notifications to a multiple e-mails, but my doubt is if I can monitoring ISE services with a network monitoring software like HP Open View. I didn't f

  • Background activity overwhelms in the middle of the day

    Just upgraded to a MacBook Pro, Intel, 10.5.2. Everything seems to work ok. But about 11:15 am, every day, the activity monitor shows CPU usage maxing out and all functions become faltering and sluggish, like typing with a stutter, you type something

  • Encrypting / decrayting values sent by post or get

    I often wish to send encrypted post or get values so that users will not be able to view values I have sent. Can anyone tell me how this is handled with Dreamweaver or ADDT and can anyone recommend a simple way of doing this. Thankyou