Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Can't edit NSTextField

Can't edit NSTextField
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2004
Status: Offline
Reply With Quote
Mar 17, 2004, 10:52 AM
 
I want to write a configuration tool in Java using the Java-Cocoa-Bridge
by hand(Without XCode and InterfaceBuilder).
The reason is that I just want to learn how can I myself imagine the mechanism of the interface builder.
Therefore I've got just a simple question.
I have added a NSTextField on my NSWindow and just want to edit it.
The typed characters only occur on my terminal shell but not in the NSTextField self. Does anybody has an idea what to do.
But please, don't answer that I should use InterfaceBuilder instead
to make that in less than one minute available.

I'm waiting for help,
mami
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Mar 17, 2004, 12:51 PM
 
I'm not quite sure I understand your question, but I assume you added the text field to the window in your code, not in IB.

Can you click in the text field and then type in it?

If so, then it sounds like you just need to set the FirstResponder to the text field so the focus initially goes there.

If not, then I think you need to provide more details on how you are reading the text input and how you added the text field.
     
mami  (op)
Fresh-Faced Recruit
Join Date: Feb 2004
Status: Offline
Reply With Quote
Mar 18, 2004, 04:30 AM
 
Yes, I can click in the TextField. But when I type all the characters occur in the terminal shell where I have started my application.
I also made the TextField as the first responder: "myWindow.makeFirstResponder(myTextField);"
I tried the same with "setInitialFirstResponder".
To your question how I have added the TextField to the window:
"MyWindow.contentView().addSubview(MyTextFIeld );".
The last thing I have tried is that I have called the
"MYTextField.setAction(new NSSelector("MyTextMethod", new Class [] {Object.class}))";
But the method "MyTextMethod" has never been reached.
I have tried the same with a NSButton and everything was o.k. .
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2