• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Issues on focus with composites and their child widgets

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys:

I have been trying this for days and cannot figure out how I can achieve what I want. I have two composites, every one of them has a button inside.

What I want to do is: when user switches from one button to another, I want to detect focus events concerning their parent composites, so I can can take appropriate actions.

The problem is: once I click on button1 in composite1, composite1 gains focus and then lost it, and button1 gains focus. This is good, at least composite1 can detect focus events. Now if I click on button2 in composite2, button1 lost focus, button2 gains focus, composite2 cannot detect any focus events. After this, neither of composites can detect focus events. How can I make composites instead of their child widgets detect their focus events?

regards,

Here is a sample printout:
composite1 focusGained
composite1 focusLost
testButton1 focusGained
testButton1 focusLost
testButton2 focusGained

Here is the sample test program:

 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic