本文整理了Java中javax.swing.JTabbedPane.setSelectedComponent()
方法的一些代码示例,展示了JTabbedPane.setSelectedComponent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.setSelectedComponent()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:setSelectedComponent
暂无
代码示例来源:origin: 4thline/cling
@Override
public void addDeviceView(DeviceView deviceView) {
Component comp = deviceView.asUIComponent();
if (tabbedPane.indexOfComponent(comp) != -1) {
tabbedPane.setSelectedIndex(tabbedPane.indexOfComponent(comp));
} else {
tabs.put(deviceView, comp);
tabbedPane.addTab(deviceView.getTitle(), comp);
tabbedPane.setSelectedComponent(comp);
}
}
代码示例来源:origin: org.netbeans.api/org-openide-dialogs
/** Setter for help URL.
* @param helpURL help URL
*/
public void setHelpURL(URL helpURL) {
if (htmlBrowser == null) {
return;
}
if (helpURL != null) {
if (!helpURL.equals(htmlBrowser.getDocumentURL())) {
htmlBrowser.setURL(helpURL);
}
if (tabbedPane != null) {
tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), true);
}
} else if (tabbedPane != null) {
tabbedPane.setSelectedComponent(contentPanel);
tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), false);
}
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
public void visit(OWLAnnotationProperty owlAnnotationProperty) {
tabbedPane.setSelectedComponent(annotationPropertySelectorPanel);
annotationPropertySelectorPanel.setSelection(owlAnnotationProperty);
}
};
代码示例来源:origin: chatty/chatty
/**
* Sets the given component as selected in the JTabbedPane.
*
* @param c
*/
public void setSelectedComponent(Component c) {
if (tabs.indexOfComponent(c) != -1) {
tabs.setSelectedComponent(c);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb
@Override
protected void selectLite(JComponent comp) {
if (soleComponent == null) {
// will call checkSelectionChange() via stateChanged()
tabbedPane.setSelectedComponent(comp);
} else {
checkSelectionChange();
}
}
代码示例来源:origin: mucommander/mucommander
public void addTab(String protocol, ServerPanel serverPanel, Class<? extends ServerPanel> selectPanelClass) {
if(!FileFactory.isRegisteredProtocol(protocol))
return;
JPanel northPanel = new JPanel(new BorderLayout());
northPanel.add(serverPanel, BorderLayout.NORTH);
tabbedPane.addTab(protocol.toUpperCase(), northPanel);
if(selectPanelClass.equals(serverPanel.getClass()))
tabbedPane.setSelectedComponent(northPanel);
serverPanels.add(serverPanel);
}
代码示例来源:origin: protegeproject/protege
public void visit(OWLAnnotationProperty owlAnnotationProperty) {
tabbedPane.setSelectedComponent(annotationPropertySelectorPanel);
annotationPropertySelectorPanel.setSelection(owlAnnotationProperty);
}
};
代码示例来源:origin: protegeproject/protege
public void visit(OWLDataProperty owlDataProperty) {
tabbedPane.setSelectedComponent(dataPropertySelectorPanel);
dataPropertySelectorPanel.setSelection(owlDataProperty);
}
代码示例来源:origin: protegeproject/protege
public void visit(OWLDatatype owlDatatype) {
tabbedPane.setSelectedComponent(datatypeSelectorPanel);
datatypeSelectorPanel.setSelection(owlDatatype);
}
代码示例来源:origin: Jamling/SmartIM
public void addConsole(IMChatConsole console) {
tabbedChat.addTab(console.getName(), console);
consoles.put(console.getUin(), console);
tabbedChat.setSelectedComponent(console);
}
代码示例来源:origin: protegeproject/protege
/**
* Adds a <code>View</code> to the holder.
* @param view The <code>View</code> to be added.
*/
public void addView(View view) {
ViewContainer viewContainer = new ViewContainer(view);
tabbedHolder.addTab(view.getViewName(), viewContainer);
tabbedHolder.setSelectedComponent(viewContainer);
}
代码示例来源:origin: org.codehaus.castor/castor-jdo
void btnPreviousActionPerformed(final ActionEvent e) {
clearTabs();
_oqlquery.setText(_qhistory.getPreviousQuery());
_tabbedPane.setSelectedComponent(_queryPanel);
}
代码示例来源:origin: org.codehaus.castor/castor-jdo
void btnNextActionPerformed(final ActionEvent e) {
clearTabs();
_oqlquery.setText(_qhistory.getNextQuery());
_tabbedPane.setSelectedComponent(_queryPanel);
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
public void run()
{
_tabbedExecutionsPanel.addTab(SQLResultExecuterPanel.i18n.EXEC_SQL_MSG,
null,
cancelPanelCtrl.getPanel(),
SQLResultExecuterPanel.i18n.CANCEL_SQL_MSG);
_tabbedExecutionsPanel.setSelectedComponent(cancelPanelCtrl.getPanel());
}
});
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
/**
* Adds a <code>View</code> to the holder.
* @param view The <code>View</code> to be added.
*/
public void addView(View view) {
ViewContainer viewContainer = new ViewContainer(view);
tabbedHolder.addTab(view.getViewName(), viewContainer);
tabbedHolder.setSelectedComponent(viewContainer);
}
代码示例来源:origin: protegeproject/protege
public boolean setEditedObject(OWLDataRange dataRange){
expressionEditor.setExpressionObject(dataRange);
if (dataRange != null && dataRange.isDatatype()){
datatypeList.setSelection((OWLDatatype)dataRange);
tabbedPane.setSelectedComponent(datatypeList);
}
else{
datatypeList.setSelection((OWLDatatype)null);
tabbedPane.setSelectedComponent(expressionScroller);
}
return true;
}
代码示例来源:origin: protegeproject/protege
public void updatePanelSelection(String selectedPanel) {
if (selectedPanel == null){
final Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ExplanationPreferencesPanel.class);
selectedPanel = prefs.getString(EXPL_PREFS_HISTORY_PANEL_KEY, null);
}
Component c = componentMap.get(selectedPanel);
if (c != null) {
tabbedPane.setSelectedComponent(c);
}
}
代码示例来源:origin: otros-systems/otroslogviewer
public void addClosableTab(String name, String tooltip, Icon icon, JComponent component, boolean show) {
JTabbedPane tabbedPane = getJTabbedPane();
if (tabbedPane.indexOfComponent(component) == -1) {
int tabCount = tabbedPane.getTabCount();
tabbedPane.addTab(name, icon, component);
tabbedPane.setTabComponentAt(tabCount, new TabHeader(tabbedPane, name, icon, tooltip));
tabbedPane.setSelectedIndex(tabCount);
}
if (show) {
tabbedPane.setSelectedComponent(component);
}
}
代码示例来源:origin: onyxbits/Raccoon
/**
* Trigger a download
*
* @param d
* packagename.
*/
public void doDownload(DownloadView d) {
downloadList.add(d);
d.startWorker();
views.setSelectedComponent(downloadListScroll);
Feedback.used(this);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui
private void replaceView(JSplitPane oldView, JSplitPane newView){
for (int i=0; i < tabPane.getTabCount(); i++){
if (oldView.equals(tabPane.getComponentAt(i))){
tabPane.setComponentAt(i, newView);
tabPane.setSelectedComponent(newView);
tabPane.validate();
copyFilterMask(oldView, newView);
continue;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!