How to fill information to NSComboBox when window loads?

  • Hi,
    I have a window and NSComboBox control on it. I want to fill information in
    that when window view or load. I am using java and cocoa.
    I created a nib file which contain window and controller code in java. I
    though to write fill method in constructor, but it throw run time error as
    controls are not initialized yet. Is there any method which i can use to
    load that?
    Thanks
  • On Oct 13, 2005, at 10:22 PM, MP 09 wrote:

    > I have a window and NSComboBox control on it. I want to fill
    > information in
    > that when window view or load. I am using java and cocoa.
    > I created a nib file which contain window and controller code in
    > java. I
    > though to write fill method in constructor, but it throw run time
    > error as
    > controls are not initialized yet. Is there any method which i can
    > use to
    > load that?

    When a nib file is loaded, all of the objects in it are unarchived or
    instantiated and connected together.  Then all of the objects in the
    nib, as well as the object specified as the nib's owner, are sent -
    awakeFromNib.  This is an appropriate place for any additional
    interface set-up work.

      -- Chris
  • I got better way to do that. That is awakeFromNib File. just use
    void awakeFromNib()
    {
    //write here code to intailize the window.
    }

    On 10/14/05, Chris Hanson <cmh...> wrote:
    >
    > On Oct 13, 2005, at 10:22 PM, MP 09 wrote:
    >
    >> I have a window and NSComboBox control on it. I want to fill
    >> information in
    >> that when window view or load. I am using java and cocoa.
    >> I created a nib file which contain window and controller code in
    >> java. I
    >> though to write fill method in constructor, but it throw run time
    >> error as
    >> controls are not initialized yet. Is there any method which i can
    >> use to
    >> load that?
    >
    > When a nib file is loaded, all of the objects in it are unarchived or
    > instantiated and connected together. Then all of the objects in the
    > nib, as well as the object specified as the nib's owner, are sent -
    > awakeFromNib. This is an appropriate place for any additional
    > interface set-up work.
    >
    > -- Chris
    >
    >
previous month october 2005 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today