moobler's Profile
Reputation: 143
Stalwart
- Group:
- Expert
- Active Posts:
- 224 (0.25 per day)
- Joined:
- 21-January 11
- Profile Views:
- 2,510
- Last Active:
Oct 25 2011 08:03 AM- Currently:
- Offline
Previous Fields
- Country:
- Who Cares
- OS Preference:
- Who Cares
- Favorite Browser:
- Who Cares
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Who Cares
- Your Car:
- Who Cares
- Dream Kudos:
- 0
- Expert In:
- Java
Posts I've Made
-
In Topic: NullPointerException when adding to tail of doubly linked list
Posted 24 Oct 2011
I think the problem is here:
//simply find the node higher weight than the one you are inserting while (current != null && (current.getPerson()).getWeight() < x.getWeight()) { current = current.getNext(); }
If current.getPerson().getWeight() has a higher weight than any other node, then it is going to keep looping until the other condition (current != null) is false. So in this case, current will be null at the end of that while loop.
The if statement on line 13 doesn't match, since there is already a single node in the list. But then the problematic statement on line 17 comes up. Since current is null, trying to execute current.getPrevious() will always give a null pointer exception. You may want to test to see if current is null and if so, then append pn to the end of the list. -
In Topic: JTable Horizontal ScrollBar not visible
Posted 3 Sep 2011
I struggled with this same problem a couple years ago. Unfortunately, I found no real solution (maybe Java 1.7 changed things?).
The only solution I could find that was sort of correct was to create a custom class for column sizing and alignment with the AUTO_RESIZE_OFF option set. This turned out to take up way too much programming time and I abandoned it before it was even close to working.
My Information
- Member Title:
- D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
-
Contact Information
- E-mail:
- Private
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
wajih1990
22 Feb 2011 - 12:01blndiecakes
15 Feb 2011 - 21:09Dogstopper
14 Feb 2011 - 19:35