Mailing Lists: Apple Mailing Lists

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

Java Cocoa Table View DataSources



I'm having some trouble with cocoa table view datasources. When I call
"mTableView.setDataSource (new ListSource (stringarray))", it seems to work
for a while but eventually crashes.

If there is a better place to go for help with Java Cocoa, let me know. I've
got some other questions about dynamically generating the widgets in the
window.

Here is the data view class:

//
// ListSource.java
// flash
//
// Created by Niko Matsakis on Wed Dec 25 2002.
//

import com.apple.cocoa.foundation.*;
import com.apple.cocoa.application.*;

public class ListSource {
protected String[] mData;

public ListSource (String[] data) {
mData = data;
}

public int numberOfRowsInTableView (NSTableView view) {
return mData.length;
}

public Object tableViewObjectValueForLocation(NSTableView v, NSTableColumn c, int idx) {
return mData[idx];
}
}


niko
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.



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.