javax.swing.JPanel.removeComponentListener()方法的使用及代码示例

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

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

JPanel.removeComponentListener介绍

暂无

代码示例

代码示例来源:origin: bcdev/beam

private void addToMapPanel(Component component) {
  if (resizeAdapter == null && component instanceof LayerCanvas) {
    final LayerCanvas layerCanvas = (LayerCanvas) component;
    resizeAdapter = new ResizeAdapter(layerCanvas);
    mapPanel.addComponentListener(resizeAdapter);
  } else {
    mapPanel.removeComponentListener(resizeAdapter);
    resizeAdapter = null;
  }
  mapPanel.removeAll();
  mapPanel.add(component, BorderLayout.CENTER);
}

代码示例来源:origin: senbox-org/snap-desktop

private void addToMapPanel(Component component) {
  if (resizeAdapter == null && component instanceof LayerCanvas) {
    final LayerCanvas layerCanvas = (LayerCanvas) component;
    resizeAdapter = new ResizeAdapter(layerCanvas);
    mapPanel.addComponentListener(resizeAdapter);
  } else {
    mapPanel.removeComponentListener(resizeAdapter);
    resizeAdapter = null;
  }
  mapPanel.removeAll();
  mapPanel.add(component, BorderLayout.CENTER);
}

代码示例来源:origin: edu.toronto.cs.savant/savant-plugin-ucscexplorer

@Override
  public void actionPerformed(ActionEvent ae) {
    if (expansion.isVisible()) {
      revealButton.setText("+");
      expansion.removeComponentListener(widthListener);
      expansion.setVisible(false);
    } else {
      revealButton.setText("-");
      ((GridLayout)expansion.getLayout()).setColumns(getWidth() / widestCheck);
      expansion.addComponentListener(widthListener);
      expansion.setVisible(true);
    }
    validate();
  }
});

相关文章

JPanel类方法