Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
beenjaminnn
Posts: 49
Registered: ‎05-02-2012
My Device: Bold 9790
My Carrier: Wind Mobile
Accepted Solution

JVM 104 Exception On Setting GaugeField Progress?

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)
Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: JVM 104 Exception On Setting GaugeField Progress?

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. 

Please use plain text.
Contributor
beenjaminnn
Posts: 49
Registered: ‎05-02-2012
My Device: Bold 9790
My Carrier: Wind Mobile

Re: JVM 104 Exception On Setting GaugeField Progress?

[ Edited ]

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

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: JVM 104 Exception On Setting GaugeField Progress?

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. 

Please use plain text.
Contributor
beenjaminnn
Posts: 49
Registered: ‎05-02-2012
My Device: Bold 9790
My Carrier: Wind Mobile

Re: JVM 104 Exception On Setting GaugeField Progress?

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

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: JVM 104 Exception On Setting GaugeField Progress?

OK, can you mark this as solved then?

 Instructions in the Help link near the top if this is new. 

Please use plain text.