| Author |
extended buttongroup does not allow me to load from database
|
elwin Ilam
Greenhorn
Joined: May 02, 2011
Posts: 11
|
|
Hi Guys,
background story:
I've got an java application with several checklists, which can be stored into a SQlite database. Everything used to work fine...
I discovered this class somewhere on the internet I decided to use it, because then i could deselect my checkboxes in a buttongroup.
The problem now is, that when I try to load the saved data from the database, it only loads like 10% of the data. It's got something to do with this extended buttongroup (because when I turn it of, everything works fine), but my knowledge of java is not good enough to see the actual problem.
So this is how I load the data from the database.
I hope you guys can give me some advice on this matter.
Thanks in advance,
Elwin
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Perhaps your database code, where it calls "setSelected" on something, is ultimately calling the "setSelected" method which you posted from the NoneSelectedButtonGroup class. And perhaps that method is throwing some kind of an exception. This being code on the Swing thread (yes?), the result would be that it would just fail silently. After processing 10% of your data, perhaps. So I would suggest looking for that.
And by the way, there's a shorter way to write the boolean expression
That shorter way is
However that doesn't have anything to do with the problem you're asking about, and it won't even produce incorrect results, it's just a bit of sloppy programming.
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
|
How are you running that code? I would guess there's a NullPointerException that you've overlooked.
|
luck, db
There are no new questions, but there may be new answers.
|
 |
elwin Ilam
Greenhorn
Joined: May 02, 2011
Posts: 11
|
|
Thanks for the advice guys,
I'll take a look at the setSelected.
@db, I'm running my code through Netbeans. Which would probably tell me if I had a nullpointerexception right?
|
 |
 |
|
|
subject: extended buttongroup does not allow me to load from database
|
|
|