Java Code Examples for javax.swing.JLayer#setLayerEventMask()

The following examples show how to use javax.swing.JLayer#setLayerEventMask() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpotlightLayerUI.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void installUI(JComponent c) {
  super.installUI(c);

  JLayer<?> jlayer = (JLayer<?>)c;
  jlayer.setLayerEventMask(
    AWTEvent.MOUSE_EVENT_MASK |
    AWTEvent.MOUSE_MOTION_EVENT_MASK
  );


}
 
Example 2
Source File: SpotlightLayerUI.java    From mars-sim with GNU General Public License v3.0 3 votes vote down vote up
@Override
 public void uninstallUI(JComponent c) {
JLayer<?> jlayer = (JLayer<?>)c;
   jlayer.setLayerEventMask(0);
   super.uninstallUI(c);
 }