Listen for when a Component is Shown for the First Time

前端 未结 6 1576
日久生厌
日久生厌 2021-01-07 22:29

I am trying to capture the very first moment when a component is shown on the screen without using \'dirty\' solutions as with use of a timer. Basically, I want to know the

6条回答
  •  情书的邮戳
    2021-01-07 23:14

    static ComponentListener cL = new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            super.componentResized(e);
            System.out.println("componentShown = "+e.getComponent().isDisplayable());
        }
    };
    

提交回复
热议问题