String nextPage = null; for (Iterator iter = allDemos.keySet().iterator(); iter.hasNext();) { String s = (String) iter.next(); if (s.equals(lastDemoOpened)) { if (iter.hasNext()) { nextPage = (String) iter.next(); break; } } } if (nextPage == null) {  Iterator iter = allDemos.keySet().iterator(); nextPage = (String) iter.next(); }  try { root.panel.loadPage((String) allDemos.get(nextPage)); lastDemoOpened = nextPage; } catch (Exception ex) { Uu.p(ex); }
navigateToNextDemo();
        public void actionPerformed(ActionEvent e) {            String nextPage = null;            for (Iterator iter = allDemos.keySet().iterator(); iter.hasNext();) {                String s = (String) iter.next();                if (s.equals(lastDemoOpened)) {                    if (iter.hasNext()) {                        nextPage = (String) iter.next();                        break;                    }                }            }            if (nextPage == null) {                // go to first page                Iterator iter = allDemos.keySet().iterator();                nextPage = (String) iter.next();            }            try {                root.panel.loadPage((String) allDemos.get(nextPage));                lastDemoOpened = nextPage;            } catch (Exception ex) {                Uu.p(ex);            }        }