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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
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)
Developer
Posts: 19,636
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. 

Contributor
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

Developer
Posts: 19,636
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. 

Contributor
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

Developer
Posts: 19,636
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.