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
New Contributor
mcdtechnology44
Posts: 6
Registered: ‎05-20-2012
My Device: Storm
Accepted Solution

Simple If Statement Issues?

[ Edited ]

Alright fellow programmers.  Once again I run into an issue I have NEVER had with any other JAVA program before.  Iam trying to figure out how to write a simple if statement and am having issues.  I have done Google searches and have not found anything to help.  So if you could please tell me what the issue may be?  The error message is "syntax error on { invalid AssignmentOperator."   Thanks in advance!

 

 

double BinRadius = (Integer.parseInt(txtRadiusFeet.getText()) * 12) + Integer.parseInt(txtRadiusInches.getText());

FieldChangeListener CalcListener = new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
double BinRadius = (Integer.parseInt(txtRadiusFeet.getText()) * 12) + Integer.parseInt(txtRadiusInches.getText());

If(BinRadius==0){
Dialog.alert("Hello");
}
};

Developer
peter_strange
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Simple If Statement Issues?

[ Edited ]

Which line is showing this?

 

On thing you might try doing is cut/pasting the code into Notepad, than cut/pasting it back.  I have had some issues where some funny non display characters got mixed up in my Java. 

 

BTW, BinRadius does not need to be double, an int would do. 

New Contributor
mcdtechnology44
Posts: 6
Registered: ‎05-20-2012
My Device: Storm

Re: Simple If Statement Issues?

If(BinRadius==0){
Developer
peter_strange
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Simple If Statement Issues?

Capital I in If?

New Contributor
mcdtechnology44
Posts: 6
Registered: ‎05-20-2012
My Device: Storm

Re: Simple If Statement Issues?

Wow, I am a redman.

Thanks!