Swing JTabbedPane throws IndexOutOfBoundsException while filling up

后端 未结 1 1446
执笔经年
执笔经年 2021-01-24 00:03

I have an application with several components. One of them is a JTabbedPane with other stuff in it (obviously). I access this pane only via this getter:

1条回答
  •  悲&欢浪女
    2021-01-24 00:43

    The stacktrace seems to suggest you access Swing components from another thread then the Event Dispatch Thread (EDT). This is not allowed.

    I am pretty certain if you would make sure you only access Swing components from the correct thread you won't see this exception anymore.

    More information can be found in the Concurrency in Swing tutorial. You can also take a look at this article which contains a RepaintManager which can help you to detect Swing threading violations

    0 讨论(0)
提交回复
热议问题