javax.swing.JTabbedPane.addMouseListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中javax.swing.JTabbedPane.addMouseListener()方法的一些代码示例,展示了JTabbedPane.addMouseListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.addMouseListener()方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:addMouseListener

JTabbedPane.addMouseListener介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Smack

menu.add(menuItem);
tabbedPane.addMouseListener(new PopupListener(menu));

代码示例来源:origin: deathmarine/Luyten

house.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
house.addChangeListener(new TabChangeListener());
house.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseClicked(MouseEvent e) {

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** Constructs a new tabbedPane manager for a given JTabbedPane */
public JTabbedPaneSmartIconManager(JTabbedPane tabbedPane) {
  this.tabbedPane = tabbedPane;
  tabbedPane.addMouseListener(this);
  tabbedPane.addMouseMotionListener(this);
}

代码示例来源:origin: protegeproject/protege

@Override
protected void installListeners() {
  super.installListeners();
  tabPane.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseReleased(MouseEvent e) {
      if(tabPane == null) {
        return;
      }
      int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY());
      if(tabIndex != -1) {
        handleTabClicked(e, tabIndex);
      }
    }
  });
}

代码示例来源:origin: antlr/antlrworks

public XJTabbedPane() {
  setLayout(new BorderLayout());
  tabbedPane.addMouseListener(new TabbedPaneMouseListener());        
}

代码示例来源:origin: com.github.arnabk/pgslookandfeel

public void enableReordering() {
  if (tabReorderingHandler == null) {
    tabReorderingHandler = new TabReorderHandler();
  }
  tabPane.addMouseListener(tabReorderingHandler);
  tabPane.addMouseMotionListener(tabReorderingHandler);
}

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

@Override
public void installListeners() {
  this.baseRolloverHandler = new MouseRolloverHandler();
  this.jcomp.addMouseMotionListener(this.baseRolloverHandler);
  this.jcomp.addMouseListener(this.baseRolloverHandler);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

protected void installDefaults() {
  super.installDefaults();
  RollOverListener l = new RollOverListener();
  tabPane.addMouseListener(l);
  tabPane.addMouseMotionListener(l);
  tabAreaInsets = NO_INSETS;
  tabInsets = new Insets(0, 0, 0, 1);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

protected void installDefaults() {
  super.installDefaults();
  RollOverListener l = new RollOverListener();
  tabPane.addMouseListener(l);
  tabPane.addMouseMotionListener(l);
  tabAreaInsets = NO_INSETS;
  tabInsets = new Insets(0, 0, 0, 1);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

protected void installDefaults() {
  super.installDefaults();
  RollOverListener l = new RollOverListener();
  tabPane.addMouseListener(l);
  tabPane.addMouseMotionListener(l);
  tabAreaInsets = NO_INSETS;
  tabInsets = new Insets(0, 0, 0, 1);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

protected void installDefaults() {
  super.installDefaults();
  RollOverListener l = new RollOverListener();
  tabPane.addMouseListener(l);
  tabPane.addMouseMotionListener(l);
  tabAreaInsets = NO_INSETS;
  tabInsets = new Insets(0, 0, 0, 1);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

protected void installDefaults() {
  super.installDefaults();
  RollOverListener l = new RollOverListener();
  tabPane.addMouseListener(l);
  tabPane.addMouseMotionListener(l);
  tabAreaInsets = NO_INSETS;
  tabInsets = new Insets(0, 0, 0, 1);
}

代码示例来源:origin: net.sf.nimrod/nimrod-laf

protected  void installListeners() {
 super.installListeners();
 miml = new MiML();
 tabPane.addMouseMotionListener( miml);
 tabPane.addMouseListener( miml);
}

代码示例来源:origin: nz.ac.waikato.cms.moa/moa

/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  jTabbedPane1 = new javax.swing.JTabbedPane();
  clusteringSetupTab = new moa.gui.clustertab.ClusteringSetupTab();
  clusteringVisualTab = new moa.gui.clustertab.ClusteringVisualTab();
  setLayout(new java.awt.BorderLayout());
  jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
      jTabbedPane1MouseClicked(evt);
    }
  });
  jTabbedPane1.addFocusListener(new java.awt.event.FocusAdapter() {
    public void focusGained(java.awt.event.FocusEvent evt) {
      jTabbedPane1FocusGained(evt);
    }
  });
  jTabbedPane1.addTab("Setup", clusteringSetupTab);
  jTabbedPane1.addTab("Visualization", clusteringVisualTab);
  add(jTabbedPane1, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: org.apache.poi/poi-contrib

private void initialiseGui() {
 cellRenderer = new SVTableCellRenderer(this.wb);
 if (allowEdits)
  cellEditor = new SVTableCellEditor(this.wb);
 //Initialise the Panel
 sheetPane = new JTabbedPane(JTabbedPane.BOTTOM);
 if (allowEdits)
  sheetPane.addMouseListener(createTabListener());
 int sheetCount = wb.getNumberOfSheets();
 for (int i=0; i<sheetCount;i++) {
  String sheetName = wb.getSheetName(i);
  //Add the new sheet to the tabbed pane
  sheetPane.addTab(sheetName, makeSheetView(wb.getSheetAt(i)));
 }
 setLayout(new BorderLayout());
 add(sheetPane, BorderLayout.CENTER);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

private void initialiseGui() {
 cellRenderer = new SVTableCellRenderer(this.wb);
 if (allowEdits)
  cellEditor = new SVTableCellEditor(this.wb);
 //Initialise the Panel
 sheetPane = new JTabbedPane(JTabbedPane.BOTTOM);
 if (allowEdits)
  sheetPane.addMouseListener(createTabListener());
 int sheetCount = wb.getNumberOfSheets();
 for (int i=0; i<sheetCount;i++) {
  String sheetName = wb.getSheetName(i);
  //Add the new sheet to the tabbed pane
  sheetPane.addTab(sheetName, makeSheetView(wb.getSheetAt(i)));
 }
 setLayout(new BorderLayout());
 add(sheetPane, BorderLayout.CENTER);
}

代码示例来源:origin: org.apache.poi/poi-examples

private void initialiseGui() {
 cellRenderer = new SVTableCellRenderer(this.wb);
 if (allowEdits)
  cellEditor = new SVTableCellEditor(this.wb);
 //Initialise the Panel
 sheetPane = new JTabbedPane(JTabbedPane.BOTTOM);
 if (allowEdits)
  sheetPane.addMouseListener(createTabListener());
 int sheetCount = wb.getNumberOfSheets();
 for (int i=0; i<sheetCount;i++) {
  String sheetName = wb.getSheetName(i);
  //Add the new sheet to the tabbed pane
  sheetPane.addTab(sheetName, makeSheetView(wb.getSheetAt(i)));
 }
 setLayout(new BorderLayout());
 add(sheetPane, BorderLayout.CENTER);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb

@Override
protected void initComponents() {
super.initComponents();
  tabbedPane = TabbedPaneFactory.createCloseButtonTabbedPane();
  tabbedPane.addPropertyChangeListener(new PropertyChangeListener() {
  @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (evt.getPropertyName().equals(TabbedPaneFactory.PROP_CLOSE)) {
        JComponent comp = (JComponent) evt.getNewValue();
    remove(comp);
      }
    }
  });
  tabbedPane.addChangeListener(new ChangeListener() {
  @Override
    public void stateChanged(ChangeEvent e) {
  checkSelectionChange();
    }
  });

popL = new PopupListener();
tabbedPane.addMouseListener(popL);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui

/** Creates a new instance of ResultWindow */
@NbBundle.Messages({"TITLE_TEST_RESULTS=Test Results",
  "ACSN_TestResults=Test Results",
  "ACSD_TestResults=Displays information about passed and failed tests and output generated by them"})
public ResultWindow() {
  super();
  setFocusable(true);
  setLayout(new BorderLayout());
  setName(ID);
  setDisplayName(Bundle.TITLE_TEST_RESULTS());
  setIcon(ImageUtilities.loadImage( "org/netbeans/modules/gsf/testrunner/ui/resources/testResults.png", true));//NOI18N
    
  AccessibleContext accContext = getAccessibleContext();
  accContext.setAccessibleName(Bundle.ACSN_TestResults());
  accContext.setAccessibleDescription(Bundle.ACSD_TestResults());
  pop = new JPopupMenu();
  pop.add(new Close());
  pop.add(new CloseAll());
  pop.add(new CloseAllButCurrent());
  popL = new PopupListener();
  closeL = new CloseListener();
  tabPane = TabbedPaneFactory.createCloseButtonTabbedPane();
  tabPane.setMinimumSize(new Dimension(0, 0));
  tabPane.addMouseListener(popL);
  tabPane.addPropertyChangeListener(closeL);
  add(tabPane);
}

代码示例来源:origin: com.github.arnabk/pgslookandfeel

protected void installListeners() {
  super.installListeners();
  if (tabHandler == null) {
    tabHandler = new TabRolloverHandler();
  }
  tabPane.addMouseListener(tabHandler);
  tabPane.addMouseMotionListener(tabHandler);
  if (propHandler == null) {
    propHandler = new MyPropertyChangeHandler();
  }
  tabPane.addPropertyChangeListener(propHandler);
  if (PlafOptions.isWheelTabbedPaneEnabled()) {
    if (tabScrollHandler == null) {
      tabScrollHandler = new TabbedPaneMouseWheelScroller();
    }
    tabPane.addMouseWheelListener(tabScrollHandler);
  }
  if (PlafOptions.isTabbedPaneRightClickSelectionEnabled()) {
    if (tabSelectionHandler == null) {
      tabSelectionHandler = new TabSelectionMouseHandler();
    }
    tabPane.addMouseListener(tabSelectionHandler);
  }
  if (PlafOptions.isTabReorderingEnabled()) {
    enableReordering();
  }
}

相关文章

JTabbedPane类方法