Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to use a combo box in java with if else

//using a combobox to do basic sums
int iNum1 = 420;
int iNum2 = 69;

if (combobox.getSelectedItem().equals("Add")) 
  int iAns = iNum1 + iNum2;
else if (combobox.getSelectedItem().equals("Subtract")) 
  int iAns = iNum1 - iNum2;
Comment

PREVIOUS NEXT
Code Example
Java :: java search string in string 
Java :: spring boot onetomany relationsion 
Java :: what is transient in java 
Java :: creating a menu in java 
Java :: input file in java 
Java :: combine two array in java 
Java :: writing values in 2d array java 
Java :: java program to Check given String is contians number or not 
Java :: java print 2d array as table 
Java :: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId; 
Java :: Java Create an OutputStream 
Java :: java actionevent 
Java :: Looping Through Array Elements Java 
Java :: java how to create an array 
Java :: Java print() and println() 
Java :: java node class 
Java :: java system.out.println not working 
Java :: concurrenthashmap in java 
Java :: float.compare java 
Java :: android pass object to activity 
Java :: remove empty elements from array java 
Java :: write message in file java 
Java :: android view set padding programmatically 
Java :: queue.isempty java 
Java :: java object into list 
Java :: a?che les paramètres de la ligne de commande triés par ordre lexicographique en java 
Java :: add recyclerview in fragment 
Java :: java generics 
Java :: how to return arraylist as array in java 
Java :: spring boot put invalid cors request 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =