JButton and next/previous object of treemap
- by supacat
I have this problem:
1) There are objects placed in the TreeMap through the JTextField. (Phonebook-like program).
2)There are buttons that implement view of available records in TreeMap.
When you click on these buttons next / previous available objects of TreeMap displaying in JTextField. (scroll through the available records).
I tried this code, but I didn't work :/
btn[4].addActionListener(new ActionListener(){
Iterator iter = tree.keySet().iterator();
public void actionPerformed(ActionEvent e) {
if (iter.hasNext()){
String str = iter.next().toString();
fldFio.setText(str);
fldNumber.setText(tree.get(str));
}
}
});