I am going to keep this discussion fairly abstract initially in hopes that I will get a broad range of approaches. Here goes...
I am working on an application which uses paint() to fill a JFrame with a "background" (a game table) and several ancillary elements (table markings, chips, etc.) At some point in the game, there will be a stack of chips on the table. Since the user cannot actually pick up and count the chips, I would like to display that value in a "text box" so the user can quickly see the number of chips in the stack.
This "text box" should have yellow text with a dark red background. The boundary for background should be just slightly larger than the text being displayed. I want to be able to specify the font style and I want to locate the box just slightly below the stack of chips.
I thought about a JLabel, but it might not be flexible enough to do what I want. I am also considering JTextField. I have tried experimenting with these, but I am running into problems with paint(). I need to figure out how to get the "text box" to the top of the "z order". So far, I cannot get it to display on top of the painted elements of the game table.
Thoughts? Suggestions?
I have code written, but it needs lots of PNG images to work and I didn't think that would be much fun for anyone.
Thanks,
Tahoe