"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