hi Sven,
the easiest approach I can think of is to use a JLabel[][] array, a panel with a gridLayout of the same size, in which you place
your labels.
Your labels can be easily filled as necessary, with some background color representing an empty field, and filled with whatever
icons to present the different objects.
The snake I would represent by an object with an arraylist of coordinates, and a field indicating the direction of movement.
And of course a timer that defines the speed.
If the snake takes an apple, you would put another pair of coordinates to your arraylist. And after moving the snake, you would check
whether the head stumbles onto something (apple, wall, itself, whatever).
And of course you need a KeyListener, and an additional panel for the scores and other control elements.
Disadvantage would be that the
unit of movement is the size of your labels, so it is not a continuous movement. I cannot remember
the original play very well, so I don't know if that would be any problem. You could set a snake by coloring your labels, or you could
use some nice icons for that (in which case you probably need an icon for each of the four directions).
Well, something like this.
Greetings,
Piet