Package io.github.jonestimd.swing
Class VisibilityHandler
- java.lang.Object
-
- io.github.jonestimd.swing.VisibilityHandler
-
- All Implemented Interfaces:
java.awt.event.HierarchyListener
,java.util.EventListener
public class VisibilityHandler extends java.lang.Object implements java.awt.event.HierarchyListener
This class can be used to invoke a callback when a component becomes visible on the screen.- See Also:
Component.isShowing()
-
-
Constructor Summary
Constructors Constructor Description VisibilityHandler(java.util.function.Consumer<java.awt.Component> onShowing)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addCallback(java.awt.Component component, java.util.function.Consumer<java.awt.Component> onShowing)
void
hierarchyChanged(java.awt.event.HierarchyEvent event)
-
-
-
Method Detail
-
addCallback
public static void addCallback(java.awt.Component component, java.util.function.Consumer<java.awt.Component> onShowing)
-
hierarchyChanged
public void hierarchyChanged(java.awt.event.HierarchyEvent event)
- Specified by:
hierarchyChanged
in interfacejava.awt.event.HierarchyListener
-
-