0
我有我的標籤問題:圖標不顯示
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"));
我已經試過這兩個選項,但是它們的圖標不顯示。爲什麼會發生?
我也試過:new ImageIcon("images/im.gif")
不存在,我還沒有任何錯誤
非常感謝!有效!! – user1256477