Switch case + condition??

Ads

 
 

Share on Google+Share on Google+

Mimy Ira Clenny
Switch case + condition??
0 Answer(s)      6 years and 11 months ago
Posted in : Java Beginners

I try to use a switch case with condition but it doesn't display anything have look:

......public void commandAction(Command c, Displayable d) { String label = c.getLabel(); if (label.equals("Exit")) { destroyApp(true); } if (label.equals("Back")) { { // go back to menu Menu(); }

  }

else { List down = (List)display.getCurrent(); switch(down.getSelectedIndex()) { case 0: Tambo(); if( label.equals("Buy")){ buy( ); }else if ( label.equals("Sell")){ sell( ); } else if(label.equals("Search")){ search();} break; case 1: Nyqeni(); if( label.equals("Buy")){ buy( ); }else if ( label.equals("Sell")){ sell( ); } else if(label.equals("Search")){ search();} break;.....

I need a help!!

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Advertisements