Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Help with NSArray

Reply
Thread Tools

Help with NSArray

 
 
CyberSpiff
Guest
Posts: n/a
 
      02-23-2005
[already posted to comp.sys.mac.programmer.help - sorry, but I just
found this newsgroup as well]

First, let me apologize for my rookie questions and possible breach of
protocol, but I am a rank beginner at Macintosh coding. I've got quite a
few years of C coding experience, but never attempted Java or anything
object-oriented. I'm laid-up after surgery and to amuse myself and learn
I'm trying to write a simple Mac app using Cocoa and Java. I've started
with searching the net and newsgroups, but in this case I haven't found
a clear-cut example.

What I want to do is pre-load a pull-down menu with entries to allow
entering of dates and times. I've got the pull-downs setup in IB, but
can't figure out how to load the text values into them. For example, the
month pull-down should contain something like "Jan" in the top entry,
followed by "Feb", etc. Days should be "1", then "2", etc.

What I'm stuck at is finding a clear example of initializing the
pull-downs. It seems like an NSArray would do the trick, but I may be
missing the boat entirely. If someone has been through this can could
provide some direction, it would be greatly appreciated.

Thanks in advance...

--
-spiff
Never be bullied into silence. Never allow yourself to be made a victim.
Accept no one's definition of your life; define yourself.

--

-spiff
Never be bullied into silence. Never allow yourself to be made a victim.
Accept no one's definition of your life; define yourself.
 
Reply With Quote
 
 
 
 
Rhino
Guest
Posts: n/a
 
      02-23-2005

"CyberSpiff" <> wrote in message
news:lF0Td.20270$.. .
> [already posted to comp.sys.mac.programmer.help - sorry, but I just
> found this newsgroup as well]
>
> First, let me apologize for my rookie questions and possible breach of
> protocol, but I am a rank beginner at Macintosh coding. I've got quite a
> few years of C coding experience, but never attempted Java or anything
> object-oriented. I'm laid-up after surgery and to amuse myself and learn
> I'm trying to write a simple Mac app using Cocoa and Java. I've started
> with searching the net and newsgroups, but in this case I haven't found
> a clear-cut example.
>

Good for you for using your time so productively!

> What I want to do is pre-load a pull-down menu with entries to allow
> entering of dates and times. I've got the pull-downs setup in IB, but
> can't figure out how to load the text values into them. For example, the
> month pull-down should contain something like "Jan" in the top entry,
> followed by "Feb", etc. Days should be "1", then "2", etc.
>

I'm not familiar with the acronym 'IB'; I'm guessing it is your IDE.

It's not at all common to see people enter data via menu items; a menu is
typically used to take you to a dialog that prompts for dates, times, names,
numbers, etc. but the menu rarely asks this information directly.

> What I'm stuck at is finding a clear example of initializing the
> pull-downs. It seems like an NSArray would do the trick, but I may be
> missing the boat entirely. If someone has been through this can could
> provide some direction, it would be greatly appreciated.
>

I don't see any class called 'NSArray' in the Java 1.5 API, nor do I see
anything that might normally be abbreviated that way, like "NameSpaceArray"
if there was such a class. Is this a non-standard class that isn't in the
standard API? If so, I can't comment on whether it is the best approach or
not.

My advice to you is to have a look at the Java Tutorial, particularly the
trail entitled "Creating a GUI with JFC/Swing", at
http://java.sun.com/docs/books/tutorial/index.html. That should do a good
job of guiding you through any GUI components you want to use, including
menus, Lists, and ComboBoxes. Initialization of Lists and ComboBoxes is
typically accomplished via Models, as you'll see in the tutorial.

Rhino


 
Reply With Quote
 
 
 
 
CyberSpiff
Guest
Posts: n/a
 
      02-23-2005
Rhino wrote:
>[snip]
>
> I don't see any class called 'NSArray' in the Java 1.5 API, nor do I see
> anything that might normally be abbreviated that way, like "NameSpaceArray"
> if there was such a class. Is this a non-standard class that isn't in the
> standard API? If so, I can't comment on whether it is the best approach or
> not.
>
> My advice to you is to have a look at the Java Tutorial, particularly the
> trail entitled "Creating a GUI with JFC/Swing", at
> http://java.sun.com/docs/books/tutorial/index.html. That should do a good
> job of guiding you through any GUI components you want to use, including
> menus, Lists, and ComboBoxes. Initialization of Lists and ComboBoxes is
> typically accomplished via Models, as you'll see in the tutorial.
>
> Rhino


Rhino, thank you for your advice. It pointed me in the right direction.
I should have been more explicit in my original post. I'm using the
Xcode development system from Apple, and the NSArray is part of their
foundation classes (NS=NEXTStep?) (forgive me if my terminology is wrong).

Your suggestion to look for ComboBoxes was very helpful. I found an
NSComboBox class that does exactly what I needed.

Now, onto file I/O!

Thank you once again...

--
-spiff
Never be bullied into silence. Never allow yourself to be made a victim.
Accept no one's definition of your life; define yourself.
 
Reply With Quote
 
Rhino
Guest
Posts: n/a
 
      02-23-2005

"CyberSpiff" <> wrote in message
news:aD2Td.20382$. ..
> Rhino wrote:
> >[snip]
> >
> > I don't see any class called 'NSArray' in the Java 1.5 API, nor do I see
> > anything that might normally be abbreviated that way, like

"NameSpaceArray"
> > if there was such a class. Is this a non-standard class that isn't in

the
> > standard API? If so, I can't comment on whether it is the best approach

or
> > not.
> >
> > My advice to you is to have a look at the Java Tutorial, particularly

the
> > trail entitled "Creating a GUI with JFC/Swing", at
> > http://java.sun.com/docs/books/tutorial/index.html. That should do a

good
> > job of guiding you through any GUI components you want to use, including
> > menus, Lists, and ComboBoxes. Initialization of Lists and ComboBoxes is
> > typically accomplished via Models, as you'll see in the tutorial.
> >
> > Rhino

>
> Rhino, thank you for your advice. It pointed me in the right direction.
> I should have been more explicit in my original post. I'm using the
> Xcode development system from Apple, and the NSArray is part of their
> foundation classes (NS=NEXTStep?) (forgive me if my terminology is wrong).
>

Thanks for the clarification

I'm not familiar with 'Xcode' and know precious little about Macs in
general. However, you may want to consider one thing before using these 'NS'
classes. There's nothing forcing you to use the two standard Java GUIs, AWT
and Swing/JFC, but if you don't use those two GUIs, your applications will
need to distribute the 'NS' classes with your application code so that other
users can run them; if you use AWT or Swing/JFC, you only need to distribute
your application and the GUI classes will already be present in the JRE
(Java Runtime Environment). Therefore, using 'NS' classes gives you a lot
more to distribute/install than if you used AWT or Swing/JFC. That could be
a major factor for you - or not.

> Your suggestion to look for ComboBoxes was very helpful. I found an
> NSComboBox class that does exactly what I needed.
>
> Now, onto file I/O!
>
> Thank you once again...
>

You're very welcome!

Rhino


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
HELP - HELP - HELP =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?= ASP .Net 4 03-09-2006 12:46 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 1 07-16-2004 01:12 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 0 07-16-2004 10:00 AM
HELP! HELP! HELP! Opening Web Application Project Error =?Utf-8?B?dHJlbGxvdzQyMg==?= ASP .Net 0 02-20-2004 05:16 PM



Advertisments