Java Cocoa Table View DataSources
Java Cocoa Table View DataSources
- Subject: Java Cocoa Table View DataSources
- From: Niko Matsakis <email@hidden>
- Date: Sat, 28 Dec 2002 14:48:14 -0500 (EST)
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.