08-18-2012 11:07 PM
Hi there,
I'm using the Eclipse plugin for BlackBerry Java. I'm fairly new to BlackBerry App development. I'm trying to create a GaugeField that will display how complete the year is, nothing complicated. When I try to construct the GaugeField with a variable as the percent it gives me "JVM 104". I tried to use setValue instead but it gives me the same result... Any ideas?
Thank you,
Ben
Here are two examples of what I'm doing, I set Completion to 50 just as an example.
int Completion = 50;
GaugeField percentGauge = new GaugeField("Percent: ", 1, 100, Completion, GaugeField.PERCENT);
add(percentGauge);
int Completion = 50;
GaugeField percentGauge = new GaugeField("Percent: ", 1, 100, 0, GaugeField.PERCENT);
percentGauge.setValue(Completion);
add(percentGauge)
Solved! Go to Solution.
08-19-2012 06:12 AM
Both approaches look valid. Which statement is giving you the 104?
If you debug using the SImulator it should stop on the failing line and give you more information.
08-19-2012 11:22 AM - edited 08-19-2012 11:26 AM
I tried it again, it gives me JVM Error 104: IllegalArgumentException, the debugger told me "Source Not Found" What does that mean?
Furthermore I tried it again using something like:
int Completion = 50;
percentComplete.setValue(Completion);
And it seems to have worked, but when I use the rest of the program to set Completion it throws IllegalArgumentException again
Thanks so much,
Ben
08-19-2012 12:47 PM
The Debugger gives you a 'Stack trace', which will list all the various methods that have been called. look down the list it gives you and you should figure out which statement in your program caused the problem.
I am wondering if you need to set the minimum value to 0, to use it as a percent.
08-21-2012 09:42 AM
I changed the minimum value to 0, I think the problem was that the program thought that I could get a number that was over 100.
I added a try... catch that seems to have fixed it!
Thank you,
Ben
08-21-2012 10:33 AM
OK, can you mark this as solved then?
Instructions in the Help link near the top if this is new.