Haxe Java窗口 [英] Haxe Java windowing

查看:61
本文介绍了Haxe Java窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Haxe.java api中,位于 http://api.haxe.org/java/index .html ,似乎不支持图形,窗口或用户交互事件.

In the Haxe.java api at http://api.haxe.org/java/index.html, there does not appear to be any support for graphics, windowing, or user-interactive events.

过去是: http://old.haxe. org/doc/java/graphics2d (请注意旧"),但是我们不能再使用这些库了:

There used to be: http://old.haxe.org/doc/java/graphics2d (note the "old"), but we can't use these libraries anymore:

import java.awt.Graphics; // Compile time error: Class not found : java.awt.Graphics.

import java.awt.*; // this works, but so does import java.nonExistantPackage.*;

Haxe是否仍支持Java图形?如果是这样,我们如何使用它?

Does Haxe still have java graphics support? If so, how can we use it?

注意:我成功安装了Java:

Note: I installed java successfully:

haxelib install hxjava

可以通过hxjava访问java.awt等.异常的部分是针对不同平台的错误消息:不是定位y时无法访问x",而是找不到x".这是非常令人困惑的,因为我在不更改目标的情况下通过使用import语句测试了api的存在.

There IS access to java.awt et al (through hxjava). The unusual part is the error message when targeting a different platform: instead of "can't access x while targeting y" it is "can't find x". This is very confusing since I tested the existence of the api by using an import statement without changing the target.

推荐答案

是的,您可以使用java.awt.*javax.swing.*软件包. 这里的要点包括您所引用的旧Haxe站点上Justinfront的代码中的基础知识.

Yes, you can use java.awt.* and javax.swing.* packages. Here's a gist including the basics from Justinfront's code on the old Haxe site that you referred to.

https://gist.github.com/cambiata/d025fc7e66352a0b0681

我在一分钟前使用Haxe 3.1.3和hxjava 3.1.0对其进行了测试-没问题. 希望这会有所帮助!

I testrun it a minute ago, using Haxe 3.1.3 and hxjava 3.1.0 - no problem. Hope this helps!

这篇关于Haxe Java窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆