• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can it be solved other than using inner class?  RSS feed

 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am creating an application that consists a split pane in JFrame. Let me call it class A. I create a JTree object that shows all the files in a directory just like a Window Explorere. I have a class that implement TreeSelectionListener, let says class B, that listens to the selected item in the left panel. B will instantiate an object from other class, let say C which displays the content of the selected file in a JPanel. If B wants to add an instance of C into right component of split panel in A, B needs to have access to split pane member of A. My question is, beside let B as an inner class of A so B can see A's split pane, is there another solution to this problem?
Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!