Code example for JList

Methods: setSelectedIndex

0
				this.letterListModel.add(i, sampleData);
				return; 
			} 
		} 
		this.letterListModel.add(this.letterListModel.size(), sampleData);
		this.letters.setSelectedIndex(i);
		this.entry.clear();
		this.sample.repaint();
 
	} 
 
	/** 
	 * Called to clear the image. 
	 *  
	 * @param event 
	 *            The event 
	 */ 
	void clear_actionPerformed(final java.awt.event.ActionEvent event) {
		this.entry.clear();
		this.sample.getData().clear();