hi i am creating an applet where you click on the button and it adds an image and text to a list, which then will be displayed in a JOptionPane but the Image will not display but the text does. code is as followed;
Add the items
String additem = (String)itemList.getSelectedItem();
if(additem.equals("Justin Bieber - Baby")){
list.add("Justin Bieber - Baby");
list.add(new ImageIcon("justin.jpg"));
} else if (additem.equals("Britney Spears - Hit me baby")) {
list.add("Britney Spears - Hit me baby");
}
Display in OptionPane
JOptionPane Order = new JOptionPane();
Order.setMessage(list);
Order.setMessageType(JOptionPane.INFORMATION_MESSAGE);
JDialog dialog = Order.createDialog(null, name.getText()+"'s"+" " + "Order");
dialog.setVisible(true);
the result is [Justin Bieber - Baby] don't understand why the [] are around the words.
also i know britney and justin are gay so no payouts its just for an assignment.
regards
jdiddy