本文整理汇总了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);
}
}
}
}
}