Search:

Type: Posts; User: hogsgonewild

Search: Search took 0.47 seconds.

  1. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    Just found the error. Should of added the key listener to the view constructor and how initialize was clear out the arraylist was incorrect. I could just set the arraylist to a new one when called...
  2. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    I tried to request the focus on the panel that was created in the view constructor which was used in the getContentPane call.
  3. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    Still isn't working. Here is the code.

    View:


    import javax.swing.JFrame;
    import java.awt.Graphics;
    import javax.swing.JPanel;
    import java.util.ArrayList;
  4. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    Currently the only time MyPanel is created is in the Views constructor and it is done inside a call: getContentPane().add(new MyPanel(c));
    Should I instead make the panel then use it in the...
  5. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    Would it be the controller that was used in the Views constructor?

    --- Update ---

    I am looking at that link and it is good info but I can't figure out how to do this in my code.
  6. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    The Panel should be the one with listener. It is also the one I need to have the focus. I am giving the view the focus but its MyPanel that has the listeners and it needs the focus. How do I request...
  7. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    Added the call to the controller code. Am I calling it right?
  8. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    I've tried but not sure if I was setting it right. How should I address it in this code?
  9. Replies
    19
    Views
    1,395

    [SOLVED] Re: keyListener keyPressed not working

    Resized it and still got no response. It seems like my call to initialize is not working right.
  10. Replies
    19
    Views
    1,395

    [SOLVED] keyListener keyPressed not working

    I'm working on a project at school and for some reason can't figure out why my keyListener isn't working. The project is in the CVM(Controller View Model) design.

    here is the view code:


    ...
Results 1 to 10 of 10