Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JList Selection & Main Execution Thread

 
henri henri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, I am working with a JList and an InternalFrameListener for a JInternalFrame.

My JList has to serve two functions. If the JInteralFrame using the method below is closed, a selection made in the JList will open an undecorated JFrame containg information about a specific actor. If the JInternalFrame is open, this function is foregone and the selection made will go into the text box meant for that item and the JFrame previously mentioned will not appear. I am trying to detect when the JInternalFrame is open or closed by using a boolean flag.
The flag used in the method below works for the method clearText() which clears all text in every text box once the window is closed. So I know it works. The boolean is a static member and is therfore expected to be used in the main class with dot notation to test for whether the JInternalFrame is open or closed.
I used it as such if(AddTitleFrame.isClosed) doSomething(); // in main class

It doesn't work.

 
henri henri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.pollscanada.com/screenshot2.html

This screenshot can better illustrates what exactly I am trying to do.
The undecorated JFrame should appear if the JInternalFrame is closed after clicking on an item in a JList that you don't see because it is behind the CardPanel on the right where you see the 26 buttons.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean with "it doesn't work"? What is not happening that you did expect to happen, in detail?
 
henri henri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.pollscanada.com/screenshot2.html


Thank you for your interest in my problem.
I have the above code in my JInternalFrame (AddTitleFrame) class.
isClosed is a static class member with default access.
it is initially declared false.

I try to use it in my main class whose visual representation you can see if you follow the above link. The boolean flag is what does not work.
I want it to work so that if the JInternalFrame is closed, when a user clicks on an actor name in the JList to the right of the visual guide, the undecorated actor JFrame will appear. If the JInternalFrame is open then the JFrame containg the ActorBean information will not open if an actor name in the list is click. It is a question of notification, but the boolean does not work in this case. It has something to do with a thread I was told. I have tried everything!!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic