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

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

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

JTabbedPane.addChangeListener介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) {
  JFrame frame = new JFrame();
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.setBounds(0, 0, 300, 400);
  frame.setLayout(null);
  final JTabbedPane tabbedPane = new JTabbedPane();
  tabbedPane.addTab("One", new JPanel());
  tabbedPane.addTab("Two", new JPanel());
  tabbedPane.addTab("Three", new JPanel());
  tabbedPane.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent e) {
      System.out.println("Tab: " + tabbedPane.getSelectedIndex());
    }
  });
  tabbedPane.setBounds(0, 0, 300, 400);
  frame.add(tabbedPane);
  frame.setVisible(true);
}

代码示例来源:origin: 4thline/cling

@PostConstruct
public void init() {
  tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
  tabbedPane.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
      Component comp = tabbedPane.getSelectedComponent();
      if (comp == null) return;
      for (Map.Entry<DeviceView, Component> entry : tabs.entrySet()) {
        if (entry.getValue().equals(comp)) {
          presenter.onDeviceViewChanged(entry.getKey());
          break;
        }
      }
    }
  });
  setLayout(new GridLayout(1, 1)); // Makes the tabs magically auto-fit in the parent container
  add(tabbedPane);
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

tabbedPane.addChangeListener(new ChangeListener(){
  @Override
  public void stateChanged(ChangeEvent e) {

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

house.addChangeListener(new TabChangeListener());
house.addMouseListener(new MouseAdapter() {
  @Override

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

@Override public void addChangeListener(ChangeListener cc) {
  synchronized (lock) {
    tabs.addChangeListener(cc);
  }
}

代码示例来源:origin: stackoverflow.com

final JTabbedPane tabbedPane = new JTabbedPane();

tabbedPane.addChangeListener(new ChangeListener() {
  public void stateChanged(ChangeEvent e) {
    //tab has been changed
  }
});

代码示例来源:origin: net.java.abeille/abeille

/**
 * Adds the tab listener to the forms tab
 */
private void addTabListener() {
  m_forms_tab.removeChangeListener(m_tab_listener);
  m_forms_tab.addChangeListener(m_tab_listener);
}

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

public OWLClassDescriptionEditor(OWLEditorKit editorKit, OWLClassExpression expression) {
  this.expression = expression;
  editingComponent = new JPanel(new BorderLayout());
  tabbedPane = new JTabbedPane();
  tabbedPane.setFocusable(false);
  editingComponent.add(tabbedPane);
  editingComponent.setPreferredSize(new Dimension(600, 400));
  tabbedPane.addChangeListener(changeListener);
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public OWLClassDescriptionEditor(OWLEditorKit editorKit, OWLClassExpression expression) {
  this.expression = expression;
  editingComponent = new JPanel(new BorderLayout());
  tabbedPane = new JTabbedPane();
  tabbedPane.setFocusable(false);
  editingComponent.add(tabbedPane);
  editingComponent.setPreferredSize(new Dimension(600, 400));
  tabbedPane.addChangeListener(changeListener);
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public OWLClassDescriptionEditor(OWLEditorKit editorKit, OWLClassExpression expression) {
  this.expression = expression;
  editingComponent = new JPanel(new BorderLayout());
  tabbedPane = new JTabbedPane();
  tabbedPane.setFocusable(false);
  editingComponent.add(tabbedPane);
  editingComponent.setPreferredSize(new Dimension(600, 400));
  tabbedPane.addChangeListener(changeListener);
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

protected void createCategories() {
  categories = new javax.swing.JTabbedPane();
  $objectMap.put("categories", categories);
  categories.setName("categories");
  categories.addChangeListener((javax.swing.event.ChangeListener) jaxx.runtime.Util.getEventListener(javax.swing.event.ChangeListener.class, "stateChanged", $JPanel0, "doStateChanged__on__categories"));
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-config

protected void createCategories() {
  $objectMap.put("categories", categories = new JTabbedPane());
  
  categories.setName("categories");
  categories.addChangeListener(JAXXUtil.getEventListener(ChangeListener.class, "stateChanged", this, "doStateChanged__on__categories"));
}

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

private void initEventHandlers() {
  this.view.tabEditors.addChangeListener(new TabChangeListener());
  this.view.listRules.setListSelectionListener(new RuleListSelectionListener());
  this.view.paneEditor.onTestCaseNumberChange = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      view.listRules.getView().updateUI();
    }
  };
}

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

private void initializeTabs () {
   tabbedPane = TabbedPaneFactory.createCloseButtonTabbedPane();
   tabbedPane.addPropertyChangeListener(this);
   tabbedPane.addTab(NbBundle.getMessage(CommitPanel.class, "CTL_CommitDialog_Tab_Commit"), basePanel); //NOI18N
   tabbedPane.setPreferredSize(basePanel.getPreferredSize());
   add(tabbedPane);
   tabbedPane.addChangeListener(this);
}

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Constructor.
 */
DockableWindowGroup(ContentPanel parent) {
  this.parent = parent;
  setLayout(new BorderLayout());
  tabbedPane = new DockedTabbedPane();
  add(tabbedPane);
  titlePanel = new TitlePanel("Hello world");
  tabbedPane.addChangeListener(titlePanel);
  add(titlePanel, BorderLayout.NORTH);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

private void initializeCommitPane () {
  if (tabbedPane == null) {
    tabbedPane = TabbedPaneFactory.createCloseButtonTabbedPane();
    tabbedPane.addPropertyChangeListener(this);
    tabbedPane.addTab(modifier.getMessage(VCSCommitPanelModifier.BundleMessage.TABS_MAIN_NAME), basePanel);
    tabbedPane.setPreferredSize(basePanel.getPreferredSize());
    add(tabbedPane);
    tabbedPane.addChangeListener(this);
  }
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private void setupTabbedPane(ObjectTreeTabbedPane pane)
{
  final SessionProperties props = _session.getProperties();
  pane.rebuild();
  final JTabbedPane p = pane.getTabbedPane();
  p.setTabPlacement(props.getObjectTabPlacement());
  p.addChangeListener(_tabPnlListener);
}

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

public void addSelectionListener(ChangeListener l){
  classSelectorPanel.addSelectionListener(l);
  objectPropertySelectorPanel.addSelectionListener(l);
  dataPropertySelectorPanel.addSelectionListener(l);
  individualSelectorPanel.addSelectionListener(l);
  datatypeSelectorPanel.addSelectionListener(l);
  annotationPropertySelectorPanel.addSelectionListener(l);
  tabbedPane.addChangeListener(l);
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public void addSelectionListener(ChangeListener l){
  classSelectorPanel.addSelectionListener(l);
  objectPropertySelectorPanel.addSelectionListener(l);
  dataPropertySelectorPanel.addSelectionListener(l);
  individualSelectorPanel.addSelectionListener(l);
  datatypeSelectorPanel.addSelectionListener(l);
  annotationPropertySelectorPanel.addSelectionListener(l);
  tabbedPane.addChangeListener(l);
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public void addSelectionListener(ChangeListener l){
  classSelectorPanel.addSelectionListener(l);
  objectPropertySelectorPanel.addSelectionListener(l);
  dataPropertySelectorPanel.addSelectionListener(l);
  individualSelectorPanel.addSelectionListener(l);
  datatypeSelectorPanel.addSelectionListener(l);
  annotationPropertySelectorPanel.addSelectionListener(l);
  tabbedPane.addChangeListener(l);
}

相关文章

JTabbedPane类方法