javax.swing.JTabbedPane.setTitleAt()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(243)

本文整理了Java中javax.swing.JTabbedPane.setTitleAt()方法的一些代码示例,展示了JTabbedPane.setTitleAt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.setTitleAt()方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:setTitleAt

JTabbedPane.setTitleAt介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Smack

/**
 * Notification that a user has logged in to the server. A new title will be set
 * to the tab of the given debugger.
 *
 * @param debugger the debugger whose connection logged in to the server
 * @param user     the user@host/resource that has just logged in
 */
static synchronized void userHasLogged(EnhancedDebugger debugger, String user) {
  int index = getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane);
  getInstance().tabbedPane.setTitleAt(
      index,
      user);
  getInstance().tabbedPane.setIconAt(
      index,
      connectionActiveIcon);
}

代码示例来源:origin: winder/Universal-G-Code-Sender

/**
 * Updates all text labels in the GUI with localized labels.
 */
private void setLocalLabels() {
  this.controlContextTabbedPane.setTitleAt(0, Localization.getString("mainWindow.swing.controlContextTabbedPane.machineControl"));
  this.controlContextTabbedPane.setTitleAt(1, Localization.getString("mainWindow.swing.controlContextTabbedPane.macros"));
  this.controlContextTabbedPane.setTitleAt(2, Localization.getString("mainWindow.swing.visualizeButton"));
  this.firmwareSettingsMenu.setText(Localization.getString("mainWindow.swing.firmwareSettingsMenu"));
  this.grblConnectionSettingsMenuItem.setText(Localization.getString("mainWindow.swing.grblConnectionSettingsMenuItem"));
  this.grblFirmwareSettingsMenuItem.setText(Localization.getString("mainWindow.swing.grblFirmwareSettingsMenuItem"));
  this.settingsMenu.setText(Localization.getString("mainWindow.swing.settingsMenu"));
  this.macroEditPanel.setToolTipText(Localization.getString("mainWindow.swing.macroInstructions"));
  this.pendantMenu.setText(Localization.getString("mainWindow.swing.pendant"));
  this.gcodeProcessorSettings.setText(Localization.getString("settings.processors.header"));
}

代码示例来源:origin: ron190/jsql-injection

SqlEngine.TAB_ERROR.setTitleAt(SqlEngine.TAB_ERROR.getTabCount() - 1, "<html><div style=\"text-align:left;width:150px;\">"+ methodError.getName() +"</div></html>");

代码示例来源:origin: winder/Universal-G-Code-Sender

this.commandLabel.setText(Localization.getString("mainWindow.swing.commandLabel"));
this.connectionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(Localization.getString("mainWindow.swing.connectionPanel")));
this.controlContextTabbedPane.setTitleAt(0, Localization.getString("mainWindow.swing.controlContextTabbedPane.machineControl"));
this.controlContextTabbedPane.setTitleAt(1, Localization.getString("mainWindow.swing.controlContextTabbedPane.macros"));
this.durationLabel.setText(Localization.getString("mainWindow.swing.durationLabel"));
this.fileModePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(Localization.getString("mainWindow.swing.fileLabel")));
this.settingsMenu.setText(Localization.getString("mainWindow.swing.settingsMenu"));
this.statusPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(Localization.getString("mainWindow.swing.statusPanel")));
this.bottomTabbedPane.setTitleAt(0, Localization.getString("mainWindow.swing.bottomTabbedPane.console"));
this.bottomTabbedPane.setTitleAt(1, Localization.getString("mainWindow.swing.bottomTabbedPane.table"));
this.latestCommentLabel.setText(Localization.getString("mainWindow.swing.latestCommentLabel"));
this.machinePosition.setText(Localization.getString("mainWindow.swing.machinePosition"));

代码示例来源:origin: antlr/antlrworks

public void setTitleAt(int index, String name) {
  panes.get(index).name = name;
  if(panes.size() > 1) {
    tabbedPane.setTitleAt(index, name);
  }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Set the title of the current (visible) tab
 *
 * @param title the tab title to use
 */
protected void setCurrentTabTitle(String title) {
 m_flowTabs.setTitleAt(getCurrentTabIndex(), title);
}

代码示例来源:origin: stackoverflow.com

public class WhateverFrame extends JFrame{
 private JTabbedPane tabbedPane;
 public WhateverFrame() {
   BrowserPanel x=new BrowserPanel();
   tabbedPane = new JTabbedPane(JTabbedPane.TOP);
   tabbedPane.add(x, BorderLayout.WEST);
   tabbedPane.setTitleAt(0, "Start");
   /*
    * add the tabbedPane to the content pane
    */
   setContentPane(tabbedPane);
 }

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

public final void setViewName(Component view, String name) {
  int viewIndex = getViewIndex(view);
  if (viewIndex == -1) return;
  if (tabs == null) firstName = name;
  else tabs.setTitleAt(viewIndex, name);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   String newSheetName = JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
   if (newSheetName != null) {
    wb.setSheetName(tabIndex, newSheetName);
    sheetPane.setTitleAt(tabIndex, newSheetName);
   }
  }
 }
}

代码示例来源:origin: org.apache.poi/poi-examples

@Override
 public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   String newSheetName = JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
   if (newSheetName != null) {
    wb.setSheetName(tabIndex, newSheetName);
    sheetPane.setTitleAt(tabIndex, newSheetName);
   }
  }
 }
}

代码示例来源:origin: org.apache.poi/poi-contrib

public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   String newSheetName = JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
   if (newSheetName != null) {
    wb.setSheetName(tabIndex, newSheetName);
    sheetPane.setTitleAt(tabIndex, newSheetName);
   }
  }
 }
}

代码示例来源:origin: ATLauncher/ATLauncher

@Override
  public void onRelocalization() {
    for (int i = 0; i < this.tabbedPane.getTabCount(); i++) {
      this.tabbedPane.setTitleAt(i, this.tabs.get(i).getTitle());
    }
  }
}

代码示例来源:origin: chatty/chatty

public void setTitleForComponent(Component comp, String title, String tooltip) {
  int index = tabs.indexOfComponent(comp);
  if (index != -1) {
    tabs.setTitleAt(index, title);
    tabs.setToolTipTextAt(index, tooltip);
  }
}

代码示例来源:origin: xyz.cofe/gui.swing

@Override
public void setTitleAt(int index, String title) {
  Component cmpt = this.getTabComponentAt(index);
  if( cmpt instanceof TabQuery )((TabQuery)cmpt).setTabTitle(title);
  super.setTitleAt(index, title);
}

代码示例来源:origin: com.nativelibs4java/jnaerator

private static void setTabTitle(JTabbedPane tabs, Component c, String string) {
  for (int i = tabs.getTabCount(); i-- != 0;) {
    Component tc = tabs.getComponent(i);//tabs.getTabComponentAt(i); 
    if (tc == c) {
      tabs.setTitleAt(i, string);
      return;
    }
  }
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void addChildrenToGearTab() {
  if (!allComponentsCreated) {
    return;
  }
  gearTab.add(gearTabUI);
  gearTab.add(selectivityUI);
  $TabInfo0.addPropertyChangeListener(new TabInfoPropertyChangeListener(gearTab, 0));
  gearTab.setTitleAt(0, t("isisfish.gear.title"));
  $TabInfo1.addPropertyChangeListener(new TabInfoPropertyChangeListener(gearTab, 1));
  gearTab.setTitleAt(1, t("isisfish.selectivity.title"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void addChildrenToStrategyTab() {
  if (!allComponentsCreated) {
    return;
  }
  strategyTab.add(strategyTabUI);
  strategyTab.add(strategyMonthInfoUI);
  $TabInfo0.addPropertyChangeListener(new TabInfoPropertyChangeListener(strategyTab, 0));
  strategyTab.setTitleAt(0, t("isisfish.strategy.title"));
  $TabInfo1.addPropertyChangeListener(new TabInfoPropertyChangeListener(strategyTab, 1));
  strategyTab.setTitleAt(1, t("isisfish.strategyMonthInfo.title"));
}

代码示例来源:origin: io.ultreia.java4all.i18n/i18n-editor

public void updateTabTitle() {
  int itemCount = getItemCount();
  String title = String.format("%s (%d/%s)", this.title, itemCount, listModel.size());
  JComponent navigationContent = parent.getNavigationContent();
  if (navigationContent instanceof JTabbedPane) {
    ((JTabbedPane) navigationContent).setTitleAt(tabIndex, title);
  }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

public synchronized void setTabTitle(int index, String title) {
 if (index < getNumTabs() && index >= 0) {
  m_flowTabs.setTitleAt(index, title);
  ((CloseableTabTitle) m_flowTabs.getTabComponentAt(index)).revalidate();
 }
}

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

private void updateTabTitle(
      final GraphCanvas graphCanvas,
      final Workflow workflow) {
    int index = XBayaGUI.this.graphTabbedPane.indexOfComponent(graphCanvas.getSwingComponent());
    String newTitle = workflow.getName();
    if (graphCanvas.isWorkflowChanged()) {
      newTitle = "*" + newTitle;
    }
    XBayaGUI.this.graphTabbedPane.setTitleAt(index, newTitle);
  }
});

相关文章

JTabbedPane类方法