Re: Cocoa classes -> Java?
Re: Cocoa classes -> Java?
- Subject: Re: Cocoa classes -> Java?
- From: "Patrick M" <email@hidden>
- Date: Tue, 15 Jan 2008 10:09:19 -0500
So as I understand it, with some additional research I have done:
Pure Java *was* possible for NSStatusItem but the official Apple bridge is
now deprecated, though this other bridge that someone mentioned might solve
that problem.
Is this also true for PrefPane? Is it possible to use a pure Java class to
create a PrefPane bundle? I am just curious at this point, it would still be
deprecated now, if it was ever possible.
Platform independent Java components are not possible because the bridge is
required to call the NSStatusItem API etc...
Thanks for the info everyone.
On Jan 15, 2008 1:19 AM, Art Taylor <email@hidden> wrote:
> You can still create NSStatusItems and manage PreferencePanes in
> Java. I just cracked open an old project I wrote in 2003 or so and
> rebuilt it in XCode 3 and Leopard (targeted to 10.5, etc.). Jikes
> wouldn't build it but javac did just fine.
>
> The guts of the NSStatusItem creation amounted to this code, in a
> method called from #awakeFromNib().
>
> NSStatusBar bar = NSStatusBar.systemStatusBar();
> statusItem = bar.statusItem(-1F);
> NSImage statusIcon = NSImage.imageNamed("statusItem");
> statusIcon.setSize(new NSSize(16.0f, 16.0f));
> statusItem.setImage(statusIcon);
> statusItem.setHighlightMode(true);
> statusItem.setMenu(theMenu);
> statusItem.setEnabled(true);
>
> I wrote it while bored, on the road, and in an hotel room so don't
> criticize it so much in retrospect.
>
> -a.
>
> On Jan 14, 2008, at 8:29 AM, Patrick M wrote:
>
> > I am researching using Java to write an application that will run on a
> > variety of platforms including Mac OS X and various Unix/Linux
> > configurations.
> >
> > My question is:
> >
> > Is there a way to create a system menu item (NSStatusItem),
> > preference pane
> > and contextual menu using Java instead of Cocoa for Mac OS X?
> >
> > I cannot seem to find anything, and Java being interpreted seems to
> > imply
> > that placing some kind of Java class in the /Library/PreferencesPane
> > directory wont work.
> >
> > Anyone had any luck? Is it documented as possible/not possible?
> > _______________________________________________
> >
> > Cocoa-dev mailing list (email@hidden)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> > @astrogoth.com
> >
> > This email sent to email@hidden
> >
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden