• Post Reply Bookmark Topic Watch Topic
  • New Topic

Object Access Question  RSS feed

 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have an instance of a JPanel class added to a JScrollPane object. I was wondering what (if) way could I communicate from the JPanel code with the JScrollPane? In the JPanel class I listen for mouse events and (if certain actions occur) I want to force the parent scroll pane to move (vertically and/or horizontally). What's the best way to communicate between nested object and parent object in this way? Thanks.

Rob
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You often call a Component inside another component a child.
You often call a Component outside another component a parent.
I think there are getParent methods which can gain access to the surrounding component.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!