本文整理了Java中javax.swing.JTabbedPane.getTitleAt()
方法的一些代码示例,展示了JTabbedPane.getTitleAt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.getTitleAt()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:getTitleAt
暂无
代码示例来源:origin: deathmarine/Luyten
public String getCurrentTabTitle() {
String tabTitle = null;
try {
int pos = house.getSelectedIndex();
if (pos >= 0) {
tabTitle = house.getTitleAt(pos);
}
} catch (Exception e1) {
Luyten.showExceptionDialog("Exception!", e1);
}
if (tabTitle == null) {
getLabel().setText("No open tab");
}
return tabTitle;
}
代码示例来源:origin: chewiebug/GCViewer
private void updateTabDisplay(GCResource gcResource) {
// enable only "parser" panel, as long as model contains no data
boolean modelHasData = gcResource.getModel() != null && gcResource.getModel().size() > 0;
for (int i = 0; i < modelChartAndDetailsPanel.getTabCount(); ++i) {
modelChartAndDetailsPanel.setEnabledAt(i,
modelHasData
|| modelChartAndDetailsPanel.getTitleAt(i).equals(
LocalisationHelper.getString("data_panel_tab_parser")));
}
if (!gcResource.isReload()) {
if (modelHasData) {
modelChartAndDetailsPanel.setSelectedIndex(0);
}
else {
modelChartAndDetailsPanel.setSelectedIndex(modelChartAndDetailsPanel.getTabCount()-1);
}
}
}
代码示例来源:origin: stackoverflow.com
String title = getTitleAt(draggedTabIndex);
removeTabAt(draggedTabIndex);
insertTab(title, null, comp, null, tabNumber);
代码示例来源:origin: com.fifesoft.rtext/fife.common
/**
* Returns the label on the "Search" tab.
*
* @return The text on the "Search" tab.
* @see #setSearchTabText
*/
public final String getSearchTabText() {
return tabbedPane.getTitleAt(2);
}
代码示例来源:origin: org.cytoscape/table-import-impl
/**
* Get selected tab name.
*
* @return name of the selected tab (i.e., sheet name)
*/
public String getSelectedSheetName() {
return tableTabbedPane.getTitleAt(tableTabbedPane.getSelectedIndex());
}
代码示例来源:origin: protegeproject/protege
@Override
public boolean shouldCloseTab(int tabIndex, JTabbedPane tabbedPane) {
int ret = JOptionPane.showConfirmDialog(tabbedPane,
String.format("Do you want to close the %s tab?", tabbedPane.getTitleAt(tabIndex)),
"Close tab?",
JOptionPane.YES_NO_OPTION);
return ret == JOptionPane.YES_OPTION;
}
代码示例来源:origin: igvteam/igv
public void selectTab(String tabname) {
if (tabname == null) return;
for (int i = 0; i < tabbedPane.getTabCount(); i++) {
if (tabbedPane.getTitleAt(i).equalsIgnoreCase(tabname)) {
tabbedPane.setSelectedIndex(i);
return;
}
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@Override
public String getText() {
int index = m_enclosingPane
.indexOfTabComponent(CloseableTabTitle.this);
if (index >= 0) {
return m_enclosingPane.getTitleAt(index);
}
return null;
}
};
代码示例来源:origin: net.sf.ingenias/editor
public String getText() {
int i = pane.indexOfTabComponent(ButtonTabComponent.this);
if (i != -1) {
return pane.getTitleAt(i);
}
return null;
}
};
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
public String getTitleAt(int index) {
if (getSelectedIndex() == index)
return "";
return super.getTitleAt(index);
}
代码示例来源:origin: fr.inria.wimmics/kggui
public String getText() {
int i = pane.indexOfTabComponent(ButtonTabComponent.this);
if (i != -1) {
return pane.getTitleAt(i);
}
return null;
}
};
代码示例来源:origin: stackoverflow.com
public int findTabByName(String title, JTabbedPane tab)
{
int tabCount = tab.getTabCount();
for (int i=0; i < tabCount; i++)
{
String tabTitle = tab.getTitleAt(i);
if (tabTitle.equals(title)) return i;
}
return -1;
}
代码示例来源:origin: UISpec4J/UISpec4J
private java.util.List<String> getTabNames() {
java.util.List<String> result = new ArrayList<String>();
for (int i = 0; i < jTabbedPane.getTabCount(); i++) {
result.add(jTabbedPane.getTitleAt(i));
}
return result;
}
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
public void windowDeactivated(WindowEvent evt)
{
String title = _tabPnl.getTitleAt(_tabPnl.getSelectedIndex());
if (title.equals(s_stringMgr.getString("AboutBoxDialog.system")))
{
_systemPnl._memoryPnl.stopTimer();
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-rules-tools
/**
* Get an info panel with a given name.
*/
public JComponent getInfoPanel(String name)
{
JComponent ret = null;
for(int i=0; ret==null && i<infopanels.getTabCount(); i++)
if(name.equals(infopanels.getTitleAt(i)))
ret = (JComponent)infopanels.getComponentAt(i);
return ret;
}
代码示例来源:origin: edu.stanford.protege/org.coode.owlviz
protected Component getTab(String name) {
for(int i = 0; i < tabPane.getTabCount(); i++) {
if(tabPane.getTitleAt(i).equals(name)) {
return tabPane.getComponentAt(i);
}
}
return null;
}
代码示例来源:origin: abbot/abbot
/** Return the row, col of the first object matching the given String. */
private int tabNameToIndex(JTabbedPane tabs, String name) {
for (int i=0;i < tabs.getTabCount();i++) {
String value = tabs.getTitleAt(i);
if (ExtendedComparator.stringsMatch(name, value))
return i;
}
return -1;
}
代码示例来源:origin: cmu-phil/tetrad
private void removeStatsTabs() {
for (int i = tabbedPane.getTabCount() - 1; i >= 0; i--) {
String name = tabbedPane.getTitleAt(i);
if (name.equals("Model Statistics")) {
tabbedPane.removeTabAt(i);
} else if (name.equals("DAG in pattern")) {
tabbedPane.removeTabAt(i);
}
}
}
代码示例来源:origin: hneemann/Digital
@Override
public void actionPerformed(ActionEvent actionEvent) {
int tab = tp.getSelectedIndex();
if (tab < 0) tab = 0;
new GraphDialog(ValueTableDialog.this, Lang.get("win_testdata_N", tp.getTitleAt(tab)), resultTableData.get(tab))
.disableTable()
.setVisible(true);
}
}.setToolTip(Lang.get("menu_showDataAsGraph_tt"));
代码示例来源:origin: tulskiy/musique
@Override
public void mouseReleased(MouseEvent e) {
if (dragFrom != -1 && dragTo != -1 && dragFrom != dragTo) {
playlistManager.movePlaylist(dragFrom, dragTo);
Component comp = tabbedPane.getComponentAt(dragFrom);
String title = tabbedPane.getTitleAt(dragFrom);
tabbedPane.removeTabAt(dragFrom);
tabbedPane.insertTab(title, null, comp, null, dragTo);
tabbedPane.setSelectedIndex(dragTo);
}
dragTo = -1;
}
内容来源于网络,如有侵权,请联系作者删除!