This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes extended buttongroup does not allow me to load from database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "extended buttongroup does not allow me to load from database" Watch "extended buttongroup does not allow me to load from database" New topic
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
    
    2

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
    
    3

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?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: extended buttongroup does not allow me to load from database
 
Similar Threads
saving data to database without pressing button
returned null;
jasperreports does not work in executable jar file
Problem with adding an XML node to an existent XML File
Setting Location for database to be used by javadb