I have a problem with my tabs:
JTabbedPane tab = new JTabbedPane();
frame.add(tab, BorderLayout.CENTER);
JPanel contact = new JPanel();
contact.add(backgroundContact);
tab.add("Contacto", contact);
//tab.addTab("Contacto",new ImageIcon("images/image2.gif"), contact,"");
JPanel schedule = new JPanel();
schedule.add(backgroundSchedule);
tab.add("Horario", schedule);
//tab.addTab("Horario", new ImageIcon("images/image2.gif"), schedule,"");
JPanel cost = new JPanel();
cost.add(backgroundCost);
tab.add("Tarifas", cost);
//tab.addTab("Tarifas", new ImageIcon("images/image3.gif"), cost,"");
// Los iconos
tab.setIconAt(0, new ImageIcon("images/image1.gif"));
tab.setIconAt(1, new ImageIcon("images/image2.gif"));
tab.setIconAt(2, new ImageIcon("images/image3.gif"));
I've tried both options, but the icons are not shown. Why is it happening?
I also tried: new ImageIcon("images/im.gif")
which doesn't exist and I haven any error