Search:

Type: Posts; User: wltrallen2

Search: Search took 0.22 seconds.

  1. Re: addActionListeners() not recognized ENTER key event for a JTextField

    Thanks, copeg. I will check out the reading and go from there. :)
  2. Re: addActionListeners() not recognized ENTER key event for a JTextField

    I hope this is an SSCCE. I think you should be able to run this and recreate my results. Thanx again for any help. :)


    import acm.program.*;
    import java.awt.event.*;
    import javax.swing.*;
    ...
  3. Re: addActionListeners() not recognized ENTER key event for a JTextField

    Pardon my newbie-ness... what's an SSCCE? Also, is there a different way to add the ActionListener to the JTextField specifically? I thought I had already added it properly as demonstrated in the 1st...
  4. Re: addActionListeners() not recognized ENTER key event for a JTextField

    Thanks, copeg. But when I run the program, I do click in the JTextField, type a string, and then hit ENTER. Nothing happens. When I hit the JButton that has the same CommandAction, then the event...
  5. addActionListeners() not recognized ENTER key event for a JTextField

    Hello, all. I have the following code in my init() method:


    friend = new JTextField(TEXT_FIELD_SIZE);
    friend.setActionCommand("Add Friend");
    add(friend, WEST);
    add(new JButton("Add...
  6. Replies
    7
    Views
    446

    [SOLVED] Re: Null Pointer Exception

    Thank you, pbrockway2, for the additional instruction. I'm really enjoying learning the language and the lingo of the programming world. Thanks for your patience and your help! :cool:
  7. Replies
    7
    Views
    446

    [SOLVED] Re: Null Pointer Exception

    Okay... so I finally answered my own question. Just for reference, I had forgotten to instantiate the ArrayList in my ivars at the bottom of the program. Instead of...

    ArrayList<String> friends =...
  8. Replies
    7
    Views
    446

    [SOLVED] Re: Null Pointer Exception

    Okay, so actually your comments were really helpful once I started digging. The original problem was the line:


    friends.clear();

    because there weren't any entries in the ArrayList<String>...
  9. Replies
    7
    Views
    446

    [SOLVED] Re: Null Pointer Exception

    Still learning terminology... Is this the stack trace to which you are referring:


    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at...
  10. Replies
    7
    Views
    446

    [SOLVED] Null Pointer Exception

    Hi. I'm learning java through Standford's Open Courseware, and while it's a phenomenal program, and I've been able to work each of the assignments on my own thus far without the teacher contact that...
Results 1 to 10 of 10