WindowListener does not work as expected

前端 未结 3 505
慢半拍i
慢半拍i 2020-12-21 07:49

I want my GUI to make some checks when a JOptionPane appears. Because I can\'t find any other way, I though I can do those each time the application window loses focus(its j

3条回答
  •  猫巷女王i
    2020-12-21 08:04

    1) JOptionPane / modal JDialog have got modality issue, but modality could be advantage if all containers have got own owner, for real workaround you need to know (I'll talking about how can I do test that)

    • numbers of Window[], and if isDisplayable(), then you can use follows

    • you can get SwingUtilities#getAccessibleIndexInXxx can returns AccessibleState

    • KeyboardFocusManager (very interesting methods for multi-touch) returns getXxxFocusXxx methods

    • Focus, FocusSubsystem is pretty asynchronous,

    2) Please, with due respect, I don't know why you needed that, for why reasons I need to know about that, there is about business rules, you always need to know ...., and if is done on EDT

    • Focus, FocusSubsystem is pretty asynchronous,

提交回复
热议问题