javax.swing.JComponent.addComponentListener()方法的使用及代码示例

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

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

JComponent.addComponentListener介绍

暂无

代码示例

代码示例来源:origin: groovy/groovy-core

public void propertyChange(PropertyChangeEvent event) {
  update();
  ((JComponent)event.getOldValue()).removeComponentListener(this);
  ((JComponent)event.getNewValue()).addComponentListener(this);
}

代码示例来源:origin: groovy/groovy-core

public synchronized void syntheticBind() {
  boundComponent = (JComponent) ((PropertyBinding)sourceBinding).getBean();
  boundComponent.addPropertyChangeListener(propertyName, this);
  boundComponent.addComponentListener(this);
}

代码示例来源:origin: JetBrains/ideavim

/**
 * Turns on the more window for the given editor
 */
private void activate() {
 JRootPane root = SwingUtilities.getRootPane(myEditor.getContentComponent());
 myOldGlass = (JComponent)root.getGlassPane();
 if (myOldGlass != null) {
  myOldLayout = myOldGlass.getLayout();
  myWasOpaque = myOldGlass.isOpaque();
  myOldGlass.setLayout(null);
  myOldGlass.setOpaque(false);
  myOldGlass.add(this);
  myOldGlass.addComponentListener(myAdapter);
 }
 setFontForElements();
 positionPanel();
 if (myOldGlass != null) {
  myOldGlass.setVisible(true);
 }
 myActive = true;
 UiHelper.requestFocus(myText);
}

代码示例来源:origin: JetBrains/ideavim

oldGlass.setOpaque(false);
oldGlass.add(this);
oldGlass.addComponentListener(adapter);
positionPanel();
oldGlass.setVisible(true);

代码示例来源:origin: winder/Universal-G-Code-Sender

/**
 * Pass in list of "ascending" Dimensions representing thresholds to larger nominal sizes.
 */
public SteppedSizeManager(JComponent component, Dimension... dimensions) {
  this.component = component;
  this.dimensions = new ArrayList<>(Arrays.asList(dimensions));
  component.addComponentListener(new ComponentAdapter() {
    @Override
    public void componentResized(ComponentEvent event) {
      determineNominalSize();
    }
  });
}

代码示例来源:origin: org.codehaus.groovy/groovy-swing

public void propertyChange(PropertyChangeEvent event) {
  update();
  ((JComponent)event.getOldValue()).removeComponentListener(this);
  ((JComponent)event.getNewValue()).addComponentListener(this);
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public void propertyChange(PropertyChangeEvent event) {
  update();
  ((JComponent)event.getOldValue()).removeComponentListener(this);
  ((JComponent)event.getNewValue()).addComponentListener(this);
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public synchronized void syntheticBind() {
  boundComponent = (JComponent) ((PropertyBinding)sourceBinding).getBean();
  boundComponent.addPropertyChangeListener(propertyName, this);
  boundComponent.addComponentListener(this);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

代码示例来源:origin: org.codehaus.groovy/groovy-swing

public synchronized void syntheticBind() {
  boundComponent = (JComponent) ((PropertyBinding)sourceBinding).getBean();
  boundComponent.addPropertyChangeListener(propertyName, this);
  boundComponent.addComponentListener(this);
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

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

public void install(JComponent attachedComponent) {
  //attachedComponent.addCaretListener(this);
  attachedComponent.addComponentListener(this);
  attachedComponent.addFocusListener(this);
  attachedComponent.addKeyListener(this);
  attachedComponent.addMouseListener(this);
  attachedComponent.addMouseMotionListener(this);
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

public void addNotify () {
  super.addNotify ();
  scene.addSceneListener (this);
  JComponent viewComponent = scene.getView ();
  if (viewComponent == null)
    viewComponent = scene.createView ();
  viewComponent.addComponentListener (this);
  repaint ();
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public void addNotify () {
  super.addNotify ();
  scene.addSceneListener (this);
  JComponent viewComponent = scene.getView ();
  if (viewComponent == null)
    viewComponent = scene.createView ();
  viewComponent.addComponentListener (this);
  repaint ();
}

代码示例来源:origin: lbalazscs/Pixelitor

@Override
public void installUI(JComponent slider) {
  slider.addMouseListener(this);
  slider.addMouseMotionListener(this);
  slider.addFocusListener(focusListener);
  slider.addKeyListener(keyListener);
  slider.addComponentListener(compListener);
  slider.addPropertyChangeListener(propertyListener);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

void registerForComponent(JComponent component) {
  if (component == null) {
    return;
  }
  component.addComponentListener(this);
  component.addKeyListener(this);
  component.addFocusListener(this);
  component.addPropertyChangeListener(this);
  component.addHierarchyListener(this);
  component.addHierarchyBoundsListener(this);
}

代码示例来源:origin: org.gephi/ui-components

@Override
public void installUI(JComponent slider) {
  slider.addMouseListener(this);
  slider.addMouseMotionListener(this);
  slider.addFocusListener(focusListener);
  slider.addKeyListener(keyListener);
  slider.addComponentListener(compListener);
  slider.addPropertyChangeListener(propertyListener);
}

代码示例来源:origin: com.google.code.validationframework/validationframework-swing

private void initComponents() {
  toolTip = new JToolTip();
  owner.addComponentListener(locationAdapter);
  owner.addAncestorListener(locationAdapter);
  getRootPane().setWindowDecorationStyle(JRootPane.NONE); // Just in case...
  setFocusable(false); // Just in case...
  setFocusableWindowState(false);
  setContentPane(toolTip);
}

相关文章

JComponent类方法