getID()源码实例Demo

java.awt.event.ComponentEvent#getID()源码实例Demo

下面列出了java.awt.event.ComponentEvent#getID() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: megamek   文件: PicMap.java
@Override
protected void processComponentEvent(ComponentEvent e) {
    switch (e.getID()) {
        case ComponentEvent.COMPONENT_RESIZED:
            onResize();
            update();
            break;
    }
}
 
源代码2 项目: consulo   文件: DesktopWindowWatcher.java
final void dispatchComponentEvent(final ComponentEvent e) {
  final int id = e.getID();
  if (WindowEvent.WINDOW_CLOSED == id || (ComponentEvent.COMPONENT_HIDDEN == id && e.getSource() instanceof Window)) {
    dispatchHiddenOrClosed(TargetAWT.from((Window)e.getSource()));
  }
  // Clear obsolete reference on root frame
  if (WindowEvent.WINDOW_CLOSED == id) {
    final Window window = (Window)e.getSource();

    if (JOptionPane.getRootFrame() == window) {
      JOptionPane.setRootFrame(null);
    }
  }
}
 
源代码3 项目: java-swing-tips   文件: MainPanel.java
@Override protected void processComponentEvent(ComponentEvent e, JLayer<? extends JScrollPane> l) {
  Component c = e.getComponent();
  if (e.getID() == ComponentEvent.COMPONENT_RESIZED && c instanceof JTableHeader) {
    l.repaint(c.getBounds());
  }
}
 
源代码评论
动弹
沙发等你来抢