My problem is , Let explain with example In a chess boad many blocks r there,right! vat i want is, if the user choose certain blocks, those block should be filled with colures, and i want to place some data to the colour filled blocks. How should i do? Do i have to go for Jtable, or java graphics or any other third party tool, Can u plz give me some solution?
There are two general approaches to this: 1 — component approach. You can make a GridLayout and add JLabels that can be used to show color (they must be 'setOpaque' to do this) and information. 2 — graphics approach. Here you do all the rendering in the 'paintComponent' method (assuming you are using Swing components like JPanel). Draw a grid and you can set colors in rectangles. The 'drawString' part takes a little more work but it's mostly a matter of counting and using Font class methods for precise positioning.
The first option may be easier and the second allows more control. Either way you will need to keep track of things in the class that manages the colors/messages for selected cells.
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
a bit of art, as a gift, the permaculture playing cards