Hola, tengo un codigo que copie de otro lado:
Código Java:
Ver originalimport java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
public class ScrollList
extends JFrame {
public ScrollList() {
super("JScrollPane Demonstration");
setSize(300, 200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
String categories
[] = { "Household",
"Office",
"Extended Family",
"Company (US)", "Company (World)", "Team", "Will",
"Birthday Card List", "High School", "Country", "Continent",
"Planet" };
}
public static void main
(String args
[]) { ScrollList sl = new ScrollList();
sl.setVisible(true);
}
}
que si que lo entiendo perfectamente

ahora quiero saber cómo se hace para que cuando el usuario haga click en uno de los items se muestre una imagen por ejemplo o haga algo, se muestren otros componentes, etc.
Agradeceria la ayuda! :D