macframe.php,在Mac应用程序中嵌入Java(.jar)文件

这篇博客探讨了如何在Mac OS(Lion和Snow Leopard)上将.jar文件集成到NSWindow中。作者参考了Apple的'JavaFrameEmbedding'示例,并成功避免了Java异常,但无法看到Applet显示。解决方案建议下载相关项目进行研究,并提供了使用Java和Cocoa创建NSWindow并运行.jar文件的示例代码。
摘要由CSDN通过智能技术生成

I need to have a .jar file run within my main NSWindow, how can I do this?

I have been looking at Apple's example for "JavaFrameEmbedding", and seem to be able to run it without any Java exceptions (previously I had exceptions), however I cannot see the applet. They use the JavaFrameView which is part of the JavaFrameEmbedding framework, although I can't find any documentation about this at all. This is using Lion (I have also tried on Snow Leopard without success).

解决方案

Download this puppy and dig through it.

If you want to make the NSWindow in java and have the program run from there try something like this:

import com.apple.cocoa.application.*;

import com.apple.cocoa.foundation.*;

public class Test {

public static void main (String [] args) {

NSApplication nsapp = NSApplication.sharedApplication();

NSRect rect = new NSRect(500, 500, 500, 500);

NSWindow.MiniaturizableWindowMask;;

NSWindow window = new NSWindow(rect, style, NSWindow.Buffered,

false);

window.makeKeyAndOrderFront(window);

nsapp.run();

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值