How do I profile the EDT in Swing?

后端 未结 3 490
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 11:31

I have an application that I\'m building in Swing. It has a scrollable and zoomable chart component which I can pan and zoom in. The whole thing is smooth except that sometime

3条回答
  •  旧巷少年郎
    2021-02-01 12:00

    I'd say it's likely this isn't actually something on the EDT but actually garbage collection.

    Assuming that's the case I don't know of any solution I'm afraid. I've actually never written anything in Swing which didn't have this type of behavior occasionally.

    To try & debug you could subclass EventQueue & install a new one using:

    Toolkit.getDefaultToolkit().getSystemEventQueue().push(xxx);

    This should allow you to at least see what events are being processed by the EDT.

提交回复
热议问题