I'm making a kind of pong game with one ball and two beams wich you can move up and down to bounce the ball and so on. You can move the two beams with A and Q and arrow up and arrow down. My problem is that when i move one beam, i can't move the other and otherwise. I've tried to use a thread in my keylistener but that didn't work. Any suggestions?
No need for a background thread as a Swing Timer would do the trick nicely (although it does use a background thread behind the scenes to accomplish its tasks).
But what should i do then? When i press on A to get the first beam higher, then i can't get the second beam down when i press on arrow up;
It's very hard to say without knowing what your code is doing. Myself, I'd use a Swing Timer and key bindings. I would not use a KeyListener for this.
Originally Posted by hannes
I also would try to work on just this problem in isolation, in a small program that does nothing but move two rectangles. Once solved in the small program, then and only then integrate it into the large program. If the small program doesn't work, then post it here (we definitely don't want to see the whole big program).
Best of luck.
riving a VGA monitor
A VGA monitor requires 5 signals to display a picture:
* R, G and B (red, green and blue signals).
* HS and VS (horizontal and vertical synchronization).
The R, G and B are analog signals, while HS and VS are digital signals.