Solved
Image not changing??
Posted on 2004-09-01
Hi..
I am doing a small GUI application a movie ticket vending machine..
I have this combo box...Inside the combo box are 3 Movie titles..
I want my program to trigger when a user selects a movie my program should display an image...
To trigger im using a actionListner... Here are my codes below..I do not know why my image doesnt seem to change...
selectTitleList.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent evt) {
String pic = selectTitleList.getSelectedItem() + ".jpg";
displayTextPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 1));
imageLabel1 = new JLabel(new ImageIcon(pic));
displayTextPanel.add(imageLabel1);
bookingDisplayArea = new JTextArea(12,50);
displayTextPanel.add(bookingDisplayArea);
}
});
I have tried using repaint() but it doesntwork...Please help me..
Thanks