Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

lineChart.getData().removeAll() vs lineChart.getData.clear() - what exactly

956261Oct 1 2012 — edited Oct 2 2012
do they both do?? The Oracle documentation truly is not very explicit (IMHO).

I have a fairly complex javaFX application that makes extensive use of lineCharts, and I'm having trouble with trying to turn off and on various series as I need to do.

I'm running into troubles where, if I use clear(), I get a Null pointer exception at times - as if I'd already cleared the chart (I have not). B at all times using that call, I do get rid of series and clear my chart, which is what I thought it did.

When I use removeAll or remove(series index) I get no nullpointer exceptions (when trying to use that call), but I also do not get anything removed!

Can someone please in simple terms tell me what these methods DO. I must be missing something.

Edited by: 953258 on Oct 1, 2012 4:15 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 30 2012
Added on Oct 1 2012
3 comments
5,679 views