Friday, April 07, 2006

The Saga of one of the most tricky problems that i have faced in Java Swing/JFC!





I got a CR(Change Request) to fix this problem on 23rd February and i completed the task on 6th April!!! Though i have not worked on this for all of these days, since i have been working on other things in between, statistics say that i have spent at least 8 days on this!

The behavior of the table shown in the images above had to be changed such that the value of checkbox should be updated only when the user explicitly clicks on the checkbox, but the behavior it had was that it would change the value of the checkbox just by clicking anywhere on the column containing the checkbox, now that was a problem since it would change the value of checkbox even if the user clicked on the column just to select that particular row!

For solving this, i had to write a special table cell renderer and editor after adding which a new problem was created! Whenever the user clicked on a checkbox, the table would go into editing mode and would never come back to normal mode, thereby disallowing selection of any other rows in the table!

Finally fixed this by figuring out that the table was dumb enough and i had to send a notification to it and programmatically stop the editing!

This is probably the most trickiest fix i have done in Java Swing/JFC till date!

The problem with User Interfaces is that the more they are easier to use, the more they are tougher to develop!

0 comments: