Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Event handling



malcom wrote:
|Now i have an NSTextField (called MyText), and i would to see, when
|the user type in it, what kind of key are pressed (return in this
|case).
|How can do it? Anyone can show me a little example here please? I
|need to connect the NSTextField as FirstResponder... or no?

It sounds like you're trying to do something NSTextField isn't intended for. What are you doing, and why do you need to know what keys are being pressed?

If Cocoa-Java is like Objective-C Cocoa, the NSTextField will become first responder when the user clicks in it. If you need to set it as the *initial* first responder, you can do that in your nib file (does Cocoa-Java use nib files?) or (likely) by calling an NSWindow method (setFirstResponder(), I'd guess).

Oh, and you don't need to apologize because you don't know as much as other people on this list. If you don't know something, asking is a perfectly proper thing to do.

Glen Fisher
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Event handling (From: malcom <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.