I have a map of names and value.
I want to iterate over the map and set the key name as Jlabel Object Name and value as the Label name.
Below is the key map.
Is there any way to set like above in java
I want to iterate over the map and set the key name as Jlabel Object Name and value as the Label name.
Below is the key map.
Code:
fieldNames.put("empname","Employee Name");
fieldNames.put("empphn1","Phone number1");
fieldNames.put("empphn2","Phone number2");
fieldNames.put("empphn3","Phone number3");
fieldNames.put("addrs","Address");
fieldNames.put("slry" ,"Salary");
for (int count=0; count < fieldNames.entrySet().size(); count++){
String key=fieldNames.entrySet().iterator().next().getKey();
// new Jlabel().setID("lbl_"+key);
// new Jlabel().setName(fieldNames.get(key));
Comment