• Post Reply Bookmark Topic Watch Topic
  • New Topic

Capturing 'far' events

 
marc bowden
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
Say I have 3 components, a JFrame and within that a JWidget
and within that a JDing.
I am simplifying this for example - there may be lots of
components within the JWidget. For reasons of robustness,
encapsuation etc I want to development the JWidget component
separately from the JFrame. I will plug the JWidget into
a panel in the JFrame when I am finished building (developing) it.
The JFrame must on occasion capture an event from a JDing.
What is the best way of doing this?
Marc
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marc,
I can think of 2 ways you can proceed.
1. Make your JWidget class have its' own listener stuff that includes the internal component events, or
2. Give outside classes a method to get a handle on the internal widgets (sort of like JScrollPane -> getHorizontalScrollbar) and let the outside class add a listener to the internal item.
I would probably try the second approach first because it seems to be the easiest.
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!