I have this code w/in my program:
I've tried several variations so that the button is grabbing the first DVD in my array which of course is "0" but I don't know where to put the zero, I have stuff commented out because I copied a button I have for "next".Code:btnFirst.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ae){ DVD dvd = (DVD)dvds.get(list.getSelectedIndex(0)); //int index = list.getSelectedIndex(); //if (index=0) index = dvds.size(); //int index = (list.getSelectedIndex(0)); list.setSelectedIndex(index); } });
Thanks!




Reply With Quote