Hi ArsalanMansoor, I have designed a Java swing application that uses JTable. An integer is entered in Column 2. A number of integers are added in Column 4 separated by commas.
When 'Enter' key is pressed after entering values in Col 2 or 4. Sum of integers in column 4 is calculated and displayed in Column 3 and percentage of this sum is calculated with respect to integer in column 2. I have done all this.
Now comes the important part, If percentage is less than 50%, the font color of that cell in column 3 should be green. If it is between 50% and 90%, the color should be yellow. For greater than 90%, the color should be red.
I have also done this but there is a bug in this part which I need to get fixed. After making entries, if I click on any row, the color of whole table changes which is undesirable.
I can share my source code. You can follow these steps to see the issue.
Create 4 rows in table by entering 4 and click 'Submit'.
Entry 1: Column 2-> 4, Column 4-> 1, Column 3 should be 1 (25%) in green.
Entry 2: Column 2-> 4, Column 4-> 1,2, Column 3 should be 3 (75%) in yellow.
Entry 3: Column 2-> 4, Column 4-> 1,3, Column 3 should be 4 (100%) in red.
Now if you click on row 1 again, the whole table font color will change to red. I don't want this thing to happen.