當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。