I'm making a simple Kakuro application in Java Swing and I have used JButton
s as cells. I've done everything from generating the grid (setBackground(Color.BLACK)
and setBackground(Color.WHITE)
) to filling with unique numbers.
But the problem is, I don't know how to paint the "clues" at the ends of JButton
s. What I want is similar to:
Sometimes the numbers may appear on only 3 sides, 2 sides or even 1 side.
I thought of setting background images, but its not possible as the numbers are sums of dynamically generated numbers (the grid is dynamic).
So any idea how to get this kind of JButton? Or if its not possible, what other options do I have?
Thanks a lot in advance (I'm really stuck).