当前位置: 首页>>代码示例>>Java>>正文


Java JToolBar.getComponentCount方法代码示例

本文整理汇总了Java中javax.swing.JToolBar.getComponentCount方法的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.getComponentCount方法的具体用法?Java JToolBar.getComponentCount怎么用?Java JToolBar.getComponentCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JToolBar的用法示例。


在下文中一共展示了JToolBar.getComponentCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stealJToolBarFromOntologyClassEditorJPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Steal the components of a JToolBar for a {@link OntologyClassEditorJPanel}.
 * @param ocep the OntologyClassEditorJPanel
 */
private void stealJToolBarFromOntologyClassEditorJPanel(OntologyClassEditorJPanel ocep) {
	
	if (ocep==null) return;
	if (this.jToolBar4UserFunction==null) return;
	
	JToolBar jToolBarUserFunctions = ocep.getJToolBarUserFunctions();
	if (jToolBarUserFunctions!=null) {
		Container containerUserFunctions = jToolBarUserFunctions.getParent();
		while (jToolBarUserFunctions.getComponentCount()>0) {
			Component comp = jToolBarUserFunctions.getComponent(0);
			this.getStolenComponentsFromJToolBarOfOntologyClassEditorJPanel().add(comp);
			jToolBarUserFunctions.remove(comp);
		}
		if (containerUserFunctions!=null) {
			containerUserFunctions.remove(jToolBarUserFunctions);	
		}
		ocep.validate();
		ocep.repaint();	
	}
	
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:26,代码来源:DynTableJPanel.java

示例2: processToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
/** Post-processes an already constructed toolbar.
 */
private void processToolBar(JToolBar toolBar) {
    for (int i = 0; i < toolBar.getComponentCount(); i++) {
        Component element = toolBar.getComponent(i);
        if (element instanceof JButton) {
            JButton button = (JButton) element;
            Action action = button.getAction();
            if (action != null) {
                getJGraph().addAccelerator(action);
            }
        }
    }
    // ensure the JGraph gets focus as soon as the graph panel
    // is clicked anywhere
    // for reasons not clear to me, mouse listeners do not work on
    // the level of the JGraphPanel
    toolBar.addMouseListener(new MouseAdapter() {
        @Override
        public void mousePressed(MouseEvent e) {
            getJGraph().requestFocus();
        }
    });
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:25,代码来源:GraphEditorTab.java

示例3: desableFocus

import javax.swing.JToolBar; //导入方法依赖的package包/类
protected void desableFocus(final JToolBar bar) {
    for (int i = 0; i < bar.getComponentCount(); i++) {
        bar.getComponent(i).setFocusable(false);
    }
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:6,代码来源:MainFrame.java


注:本文中的javax.swing.JToolBar.getComponentCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。