public void changeTitle(){ int current_tab = super.getSelectedIndex(); if (!super.getTitleAt(current_tab).substring(0, 1).equalsIgnoreCase("*")){ String title = super.getTitleAt(current_tab); System.out.println("Title tab (getTitleAt) : "+title); title = "* " + title; super.setTitleAt(current_tab,title); for(int i = 0; i < super.getTabCount(); i++){ System.out.println("Title tab after_setTitleAt : "+super.getTitleAt(i)); } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionif (!super.getTitleAt(current_tab).substring(0, 1).equalsIgnoreCase("*")){
if (!super.getTitleAt(current_tab).startsWith("*")){
public void TabPane(int pIndex, MyTabbedPane pane) { setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); this.pane = pane; index = pIndex; String title = pane.getTitleAt(pIndex); title = "* " + title ; pane.setTitleAt(index, title); name = title; JLabel label = new JLabel(title); add(label); }