This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes concurrentAccess Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "concurrentAccess Exception" Watch "concurrentAccess Exception" New topic

concurrentAccess Exception

Ranganath Junpal
Ranch Hand

Joined: Aug 31, 2006
Posts: 76
I have an JTabpane which i use to show the different files in the tabs.
I am storing the index no of the tab and the file assciated with it in an hashMap.
when i remove one tab obviously the index of the other tabs change. So when i try to change the index of other tabs in the tab.containerListeners removed Event i get an error as Concurrent Resource exception.. can any one let me know how to go about this.. Ie how to change the index of my hash map when the tab is removed..

Thank you.
Brian Cole
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
It's hard to be specific since you haven't showed us the code that is causing the problem.

If you are getting a ConcurrentModificationException (which I can't quite tell from your post) then you are modifying a Collection while you are iterating through it, which is (usually) forbidden.

[edit: Your title says "concurrentAccess Exception", which I think is an EJB thing. Your post says "Concurrent Resource exception", which which I am not familiar.]
[ March 20, 2007: Message edited by: Brian Cole ]

bitguru blog
I agree. Here's the link:
subject: concurrentAccess Exception