The program is supposed to have a menu bar with 0-9 menu items. When you click on one item the number should display. Then it should also have a key listener: when you would press a key (0-9) that number would print.
I had some troubels, couldn't get any response from pressing keys so I went the mouse listener way to try and pinpoint the problem.
Pic 1: I start the program, open menu "Items" and click on 9 that is then displayed.
Pic 2: I then left click on panel and get this result.
Why does it paint another menubar that isn't even functional?
How would I do the keyListener part?
-I tried something along the lines: ...KeyAdapter....KeyTyped.....x=event.getKeyCode()... But it didn't even recognize any key I pressed.
Also, how can I "debug" this program. I try to execute it line by line and put breakpoints in every method but it just executes to the part setVisible(true) and then I can't do anything more with it. It won't show menu, I can exit it...