本文整理匯總了Java中javax.swing.JTabbedPane.setTitleAt方法的典型用法代碼示例。如果您正苦於以下問題:Java JTabbedPane.setTitleAt方法的具體用法?Java JTabbedPane.setTitleAt怎麽用?Java JTabbedPane.setTitleAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JTabbedPane
的用法示例。
在下文中一共展示了JTabbedPane.setTitleAt方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loc
import javax.swing.JTabbedPane; //導入方法依賴的package包/類
private static void loc(JTabbedPane p, int tabIdx, String key, JEditorPane ep) {
JLabel label = new JLabel(); // Only for setting tab names
String tabName = loc("CTL_" + key); //NOI18N
Mnemonics.setLocalizedText(label, tabName);
p.setTitleAt(tabIdx, label.getText());
int idx = Mnemonics.findMnemonicAmpersand(tabName);
if (idx != -1 && idx + 1 < tabName.length()) {
char ch = Character.toUpperCase(tabName.charAt(idx + 1));
p.setMnemonicAt(tabIdx, ch);
if (ep != null) {
ep.setFocusAccelerator(ch);
}
}
}
示例2: setTabTitle
import javax.swing.JTabbedPane; //導入方法依賴的package包/類
/**
* Sets the tab title.
*/
private void setTabTitle() {
String tabTitle = "";
if (this.getSeriesTableModels().size()==0) {
tabTitle = "Table (0)";
} else {
tabTitle = "Table (" + (currSeriesSelection+1) + "/" + this.getSeriesTableModels().size() + ")";
}
Container tableTab = this.myJTable.getParent().getParent().getParent();
JTabbedPane editorTabbedPane =(JTabbedPane) tableTab.getParent();
if (editorTabbedPane!=null) {
int tabPosIndex = 0;
for (tabPosIndex=0; tabPosIndex<editorTabbedPane.getTabCount(); tabPosIndex++) {
if (editorTabbedPane.getComponentAt(tabPosIndex)==tableTab) {
break;
}
}
editorTabbedPane.setTitleAt(tabPosIndex, tabTitle);
}
}
示例3: renameTestDataTabs
import javax.swing.JTabbedPane; //導入方法依賴的package包/類
private void renameTestDataTabs(String oldName, String newName) {
JTabbedPane selectedTab = (JTabbedPane) envTab.getSelectedComponent();
for (Object object : envTab.getComponents()) {
if (!object.equals(selectedTab) && object instanceof JTabbedPane) {
JTabbedPane env = (JTabbedPane) object;
for (int i = 0; i < env.getTabCount(); i++) {
if (env.getTitleAt(i).equals(oldName)) {
env.setTitleAt(i, newName);
}
}
}
}
}