# Checkbox Has Focus

**URL:** <https://forum.inductiveautomation.com/t/checkbox-has-focus/38617>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [September 11, 2020, 10:39pm UTC](https://forum.inductiveautomation.com/t/checkbox-has-focus/38617 "2020-09-11T22:39:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 11, 2020, 10:39pm UTC](https://forum.inductiveautomation.com/t/checkbox-has-focus/38617/1 "2020-09-11T22:39:21Z")

</div>

Vision v8.0.15.  
I usually use this code to catch if something has focus…

```auto
from java.awt import KeyboardFocusManager
focusedComponent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()

if event.propertyName == "selected" and focusedComponent.name == event.source.name:
	print 'changed'

```

… this works on textboxes, numeric boxes, dropdowns, etc., but it will not work on a checkbox.

Does anyone have any ideas?

Edit, it doesn’t work on popup calendar either. FocusedComponent.name comes back as None.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 11, 2020, 11:20pm UTC](https://forum.inductiveautomation.com/t/checkbox-has-focus/38617/2 "2020-09-11T23:20:06Z")

</div>

I had focusable unchecked on the checkbox. After checking it worked. But the popup calendar still doesn’t work and it doesn’t have a focus property. I tried doing this…

```auto
comp = event.source
comp.setFocusable(True)

```

… but no worky. Any ideas on how to get the focus from popup calendar?
