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...
Type: Posts; User: hogsgonewild
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...
I tried to request the focus on the panel that was created in the view constructor which was used in the getContentPane call.
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;
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...
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.
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...
Added the call to the controller code. Am I calling it right?
I've tried but not sure if I was setting it right. How should I address it in this code?
Resized it and still got no response. It seems like my call to initialize is not working right.
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:
...