Mailing Lists: Apple Mailing Lists

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

Re: spreadsheets-NSTableView-JTable???



email@hidden wrote:
| This may be off-topic. If it is direct me to the correct list. 

It's fine here, so long as you're writing in Java. However, since your questions seem to be more about Cocoa than Java, you might do better to post to cocoa-dev.


| I need to build [a spreadsheet]. I wanted to write it all in Cocoa. I
| thought that NEXT, and then OSX, were firmly established and matured
| frameworks.

They're probably as mature as anything out there.


| I planned on using NSTableView. 
| 
| Then I read a MacTech article on NSTableView (MacTech - v.18-no.9,
| Sept.2002) and my impression from that article is that NSTableView is
| NOT applicable for "cell-based display and selection like you would
| find in a spreadsheet." [MacTech, v.18, no.9, page 8, column 1,
| Introduction, paragraph 2, line 8] The article then said it would be
| wise to roll your own classes if you want to use Cocoa.  

As I've no idea what the author said, nor what the context was, it's hard to comment. It would have been helpful had you quoted the relevant text. (The article in question isn't available on mactech.com, and I don't have any paper back issues handy.)

*Why* did the author say this? What did he claim was wrong? What made NSTableView so broken that he considered it less effort to duplicate NSTableView than to make NSTableView itself work? Lots of people have successfully used NSTableView; the odds are good that whatever the author's problem was, it was *his* problem, and not that of the library. (This is a consequence of the general rule: any given bug is far more likely to be in the application than the library or the OS.) Certainly, I've used NSTableView successfully;  it's not all that hard to use, and I can't imagine why anyone would say "avoid NSTableView in favor of a homebrew table class".


| A number of websites show simple pure-Java examples of JTables.  

There are probably quite a few web sites showing simple pure-Objective-C examples of NSTableViews. *Java* examples may be rather harder to come by; most Cocoa users write in Objective-C (which is, after all, the language Cocoa was designed to be used with).


| Has anybody been able to use JTable in a Cocoa app for spreadsheet-like work?

Probably not. JTable, not being a Cocoa class, doesn't behave the way Cocoa expects UI components to behave. (For example, you can't sent it NSEvents.) As far as I know, there's no way to plug a Swing component into the Cocoa event-dispatch mechanism.


| Is it possible? Can you drag-and-drop text between the desktop and/or Cocoa objects and a JTable object? 

Yes. Cocoa and Swing components support drag-and-drop; whether an NSTableView can make sense of data dragged from a JTable (or a JTable make sense of data from an NSTableView), I don't know.


| Is there a better alternative than JTable or NSTableView?

Better how? You haven't said what's wrong with JTable and NSTableView. Without knowing what your objections are, it's hard to know what might address those objections.


| What do people on this list use?  

Swing users: JTable. Cocoa users: NSTableView. SWT users: whatever SWT's table class is.

Glen Fisher


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >spreadsheets-NSTableView-JTable??? (From: email@hidden)



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.