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

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

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

JDesktopPane.addMouseListener介绍

暂无

代码示例

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

protected void initListeners() {
  if (internalPropertyChangeSupport == null) {
    /// Init just once
    internalPropertyChangeSupport = new PropertyChangeSupport(this);
    internalPropertyChangeSupport.addPropertyChangeListener("component", new ComponentListener());
    internalPropertyChangeSupport.addPropertyChangeListener("disabledIcon", new DisabledIconListener());
    internalPropertyChangeSupport.addPropertyChangeListener("icon", new IconListener());
    internalPropertyChangeSupport.addPropertyChangeListener("enabled", new EnabledListener());
    internalPropertyChangeSupport.addPropertyChangeListener("foreground", new ForegroundListener());
    internalPropertyChangeSupport.addPropertyChangeListener("popupMenu", new PopupMenuListener());
    internalPropertyChangeSupport.addPropertyChangeListener("title", new TitleListener());
    internalPropertyChangeSupport.addPropertyChangeListener("toolTipText", new ToolTipTextListener());
    DetachedListener detachedListener = new DetachedListener();
    internalPropertyChangeSupport.addPropertyChangeListener("detached.dispose", detachedListener);
    internalPropertyChangeSupport.addPropertyChangeListener("detached", detachedListener);
    MaximizedListener maximizedListener = new MaximizedListener();
    internalPropertyChangeSupport.addPropertyChangeListener("maximized.before", maximizedListener);
    internalPropertyChangeSupport.addPropertyChangeListener("maximized", maximizedListener);
    internalPropertyChangeSupport.addPropertyChangeListener("minimized", new MinimizedListener());
    desktopPane.addMouseListener(new PopupMouseListener());
  }
}

代码示例来源:origin: com.numdata/numdata-swing

/**
 * Constructs a new context.
 *
 * @param rootPane Root pane that will contain the window.
 */
public LightweightWindowManager( final JRootPane rootPane )
{
  _rootPane = rootPane;
  final JDesktopPane desktop = new JDesktopPane()
  {
    @Override
    protected void paintComponent( final Graphics g )
    {
      g.setColor( new Color( 0, true ) );
      g.fillRect( 0, 0, getWidth(), getHeight() );
    }
  };
  desktop.setOpaque( false );
  /*
   * Block mouse events to components beneath the glass pane.
   */
  final MouseAdapter mouseListener = new MouseAdapter()
  {
  };
  desktop.addMouseListener( mouseListener );
  desktop.addMouseWheelListener( mouseListener );
  desktop.addMouseMotionListener( mouseListener );
  _desktop = desktop;
  _internalFrameListener = new FrameListener();
}

相关文章