[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [qftestJUI] How to check which component has the focus ?
Thanks Greg, This mailing list contains lots of usefull informations... But it's sometimes hard to find exactly the answer to a question. Maybe you should create a cookbook (or How To) page whith answers to common questions... Philippe -----Original Message----- From: Gregor Schmid [mailto:Gregor.Schmid@?.de] Sent: Thursday, 20 October, 2005 08:52 To: qftestJUI-list@?.de Cc: Philippe Gaudin Subject: Re: [qftestJUI] How to check which component has the focus ? Hi Philippe, you can use com = rc.getComponent("qftest ID of component that should have focus") rc.check(KeyboardFocusManager.getCurrentKeyboardFocusManager().getPerman entFocusOwner() == com, "Focus check") Best regards, Greg "Philippe Gaudin" <Philippe.Gaudin@?.com> writes: > Hi, > > > > I would like to be able to write checks to verify that the focus is on > the expected component (this component is not always editable). > > > > One idea I had was to create a simple class returning the > KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocu > sOwner()... so I can get the Component owning the focus. > > > > I could call the class method with Jython... but I would like to > compare this java.awt.Component with a component under the "Windows > and components"... > > > > How can I do that ? > > > > Any other ideas to check the focus ? > > > > Thanks in advance ! > > > > Philippe Gaudin _______________________________________________ > qftestJUI-list mailing list > qftestJUI-list@?.de > http://www.qfs.de/mailman/listinfo/qftestjui-list -- Gregor Schmid Gregor.Schmid@?.de Quality First Software GmbH http://www.qfs.de Tulpenstr. 41 Tel: +49 8171 919870 DE-82538 Geretsried Fax: +49 8171 919876