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


Java JTabbedPane.addMouseListener方法代码示例

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


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

示例1: buildControlPanel

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
@Override
public JPanel buildControlPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    final JTabbedPane pane = new JTabbedPane();
    pane.addTab("Basic controls", basicTab = new CochleaAMS1cBasicPanel(CochleaAMS1c.this));      //creates a new basic (user friendly) panel
    pane.addTab("Expert controls", expertTab = new CochleaAMS1cControlPanel(CochleaAMS1c.this));  //creates a new expert panel with all biases
    panel.add(pane, BorderLayout.CENTER);
    pane.setSelectedIndex(getPrefs().getInt("CochleaAMS1c.selectedBiasgenControlTab", 0));
    pane.addMouseListener(new java.awt.event.MouseAdapter() {

    @Override
    public void mouseClicked(java.awt.event.MouseEvent evt) {
         getPrefs().putInt("CochleaAMS1c.selectedBiasgenControlTab", pane.getSelectedIndex());
    }
    });

            return panel;

   // CochleaAMS1cControlPanel myControlPanel = new CochleaAMS1cControlPanel(CochleaAMS1c.this);
   // return myControlPanel;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:CochleaAMS1c.java

示例2: buildControlPanel

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
@Override
public JPanel buildControlPanel() {     //added new control panel for AMS1b, similiar look as DVS128 control panel @philipp
                  JPanel panel = new JPanel();
                  panel.setLayout(new BorderLayout());
                  final JTabbedPane pane = new JTabbedPane();
                  pane.addTab("Basic controls", basicTab = new CochleaAMS1bBasicPanel(CochleaAMS1b.this));      //creates a new basic (user friendly) panel
                  pane.addTab("Expert controls", expertTab = new CochleaAMS1bControlPanel(CochleaAMS1b.this));  //creates a new expert panel with all biases
                  panel.add(pane, BorderLayout.CENTER);
                  pane.setSelectedIndex(getPrefs().getInt("CochleaAMS1b.selectedBiasgenControlTab", 0));
                  pane.addMouseListener(new java.awt.event.MouseAdapter() {

                  @Override
                  public void mouseClicked(java.awt.event.MouseEvent evt) {
                       getPrefs().putInt("CochleaAMS1b.selectedBiasgenControlTab", pane.getSelectedIndex());
                  }
                  });

                  return panel;

//	CochleaAMS1bControlPanel myControlPanel = new CochleaAMS1bControlPanel(CochleaAMS1b.this);
//	return myControlPanel;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:CochleaAMS1b.java

示例3: buildControlPanel

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/** @return a new panel for controlling this bias generator functionally
 */
@Override
public JPanel buildControlPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    final JTabbedPane pane = new JTabbedPane();

    pane.addTab("Basic controls", basicTab = new DVSFunctionalControlPanel(DVS128andCochleaAMS1b.this));
    pane.addTab("Expert controls", expertTab = super.buildControlPanel());
    panel.add(pane, BorderLayout.CENTER);
    pane.setSelectedIndex(getPrefs().getInt("DVS128.selectedBiasgenControlTab", 0));
    pane.addMouseListener(new java.awt.event.MouseAdapter() {

        public void mouseClicked(java.awt.event.MouseEvent evt) {
            getPrefs().putInt("DVS128.selectedBiasgenControlTab", pane.getSelectedIndex());
        }
    });

    return panel;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:22,代码来源:DVS128andCochleaAMS1b.java

示例4: buildControlPanel

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
 * @return a new panel for controlling this bias generator functionally
 */
@Override
public JPanel buildControlPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    final JTabbedPane pane = new JTabbedPane();

    pane.addTab("Basic controls", basicTab = new DVSFunctionalControlPanel(DVS128.this));
    pane.addTab("Expert controls", expertTab = super.buildControlPanel());
    panel.add(pane, BorderLayout.CENTER);
    pane.setSelectedIndex(getPrefs().getInt("DVS128.selectedBiasgenControlTab", 0));
    pane.addMouseListener(new java.awt.event.MouseAdapter() {

        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            getPrefs().putInt("DVS128.selectedBiasgenControlTab", pane.getSelectedIndex());
        }
    });

    return panel;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:24,代码来源:DVS128.java

示例5: TabbedPanel

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public TabbedPanel() {
	setLayout(new BorderLayout());
	pane = new JTabbedPane(JTabbedPane.TOP);
	pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
	pane.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseReleased(MouseEvent e) {
			// Only close tabs when middle-clicked
			if (e.getButton() != MouseEvent.BUTTON2) {
				return;
			}
			int index = pane.getSelectedIndex();
			if (index >= 0) {
				String key = childToTitle.remove(pane.getSelectedComponent());
				titleToChild.remove(key);
				pane.remove(index);
			}
		}
	});
	add(pane, BorderLayout.CENTER);
}
 
开发者ID:Col-E,项目名称:Recaf,代码行数:22,代码来源:TabbedPanel.java

示例6: createNewTestDataTab

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private JTabbedPane createNewTestDataTab(TestData sTestData) {
    JTabbedPane testdataTab = new JTabbedPane();
    testdataTab.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    testdataTab.setTabPlacement(JTabbedPane.BOTTOM);
    addToTab(testdataTab, sTestData.getGlobalData(), true);
    for (AbstractDataModel std : sTestData.getTestDataList()) {
        addToTab(testdataTab, std, false);
    }

    JLabel label = new JLabel("Click + to Add New TestData");
    testdataTab.addTab("", ADD_NEW_TAB_ICON, label);
    label.setHorizontalAlignment(JLabel.CENTER);
    TabTitleEditListener l = new TabTitleEditListener(testdataTab, onTestDataRenameAction(), 0);
    l.setOnMiddleClickAction(onCloseAction());
    testdataTab.addChangeListener(l);
    testdataTab.addMouseListener(l);
    testdataTab.addChangeListener(this);
    testdataTab.addMouseListener(onAddNewTDTab());
    testdataTab.setComponentPopupMenu(testDataTabPopup);
    return testdataTab;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:22,代码来源:TestDataComponent.java

示例7: addPanel

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
void addPanel(JPanel panel) {
    RefactoringPanel.checkEventThread();
    if (getComponentCount() == 0) {
        add(panel, BorderLayout.CENTER);
    } else {
        Component comp = getComponent(0);
        if (comp instanceof JTabbedPane) {
            ((JTabbedPane) comp).addTab(panel.getName(), null, panel, panel.getToolTipText());
            ((JTabbedPane) comp).setSelectedComponent(panel);
            comp.validate();
        } else if (comp instanceof JLabel) {
            remove(comp);
            add(panel, BorderLayout.CENTER);
        } else {
            remove(comp);
            JTabbedPane pane = TabbedPaneFactory.createCloseButtonTabbedPane();
            pane.addMouseListener(listener);
            pane.addPropertyChangeListener(closeL);
            add(pane, BorderLayout.CENTER);
            pane.addTab(comp.getName(), null, comp, ((JPanel) comp).getToolTipText());
            pane.addTab(panel.getName(), null, panel, panel.getToolTipText());
            pane.setSelectedComponent(panel);
            pane.validate();
        }
    }
    if (!isVisible) {
        isVisible = true;
        open();
    }
    validate();
    requestActive();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:RefactoringPanelContainer.java


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