KeyListener, MouseListener and repaint problem [solved]

I was working to create a Sudoku game using JFrame and JPanel.

I wasn’t sure where the mistakes are but when I tried to press a key, the key listener works but it’s not updating the graphics. It seems that the Panel only redraw it once but I did repaint all the tiles in a while loop.

Here is a sneak peak of the code :-

Sudoku class aka. main method
Tile class

It’s not too long cause it’s just a simple game and I didn’t start working into the logic yet.