JButton and next/previous object of treemap
        Posted  
        
            by 
                supacat
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by supacat
        
        
        
        Published on 2012-10-28T13:49:57Z
        Indexed on 
            2012/10/28
            17:00 UTC
        
        
        Read the original article
        Hit count: 259
        
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));
         }
      }
}); 
© Stack Overflow or respective owner