Win32 GUI 演示应用程序到 Java(小程序)GUI
我有一个简单的旧版 C win32 GUI 应用程序,可以调用 win32 GUI API。我已将 C 演示应用程序重新编写为 Java 小程序,现在我想将图形部分更改为其 Java 等效部分。
我已经浏览了图形函数,这是正在使用的win32 API函数的列表:
- CreateEllipticRgn
- CreateFont
- CreatePen
- CreatePolygonRgn
- CreateRectRgn
- CreateSolidBrush
- CreateSolidBrush
- DeleteObject
- DrawEdge
- ExtTextOut
- FillRect
- FrameRect
- GetTextExtentPoint32
- GetTextMetrics
- InflateRect
- LineTo
- MoveToEx
- PtInRect
- Rectangle
- RectVisible
- SelectObject
- SetBkColor
- SetPixelV
- SetTextAlign
- SetTextColor
我还没有完成任何GUI 编程,所以我不太确定使用哪个 Java GUI 框架 - 似乎有很多。
任何人都可以帮忙:
- 推荐哪个 GUI 框架用于我的小程序,
- 提供映射到上面列出的 Win32 API 函数的 java 图形函数?
I have a trivial legacy C win32 GUI app that makes calls to the win32 GUI API. I have reqritten the C demo app as a Java applet, and I now want to now change the graphics portion to its Java equivalent.
I have gone through the graphics functions and this is the list of win32 API functions being used:
- CreateEllipticRgn
- CreateFont
- CreatePen
- CreatePolygonRgn
- CreateRectRgn
- CreateSolidBrush
- CreateSolidBrush
- DeleteObject
- DrawEdge
- ExtTextOut
- FillRect
- FrameRect
- GetTextExtentPoint32
- GetTextMetrics
- InflateRect
- LineTo
- MoveToEx
- PtInRect
- Rectangle
- RectVisible
- SelectObject
- SetBkColor
- SetPixelV
- SetTextAlign
- SetTextColor
I have not yet done any GUI programming so am not quite sure which Java GUI framework to use - there appears to be so many.
Can anyone help with:
- recommending which GUI framework to use for my applet
- providing the java Graphics functions that map to the Win32 API functions listed above?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最明显的选择是 Swing,但不要期望 Win32 GUI API 和 Swing 之间有一对一的映射。
在 Win32 中,有使用句柄作为对象标识符的函数;在 Swing 中你有一个真正的 OO GUI 框架。此外,处理事件的方式也有很大不同。
要进行移植,您必须了解 Win32 和 Win32 是如何进行移植的。先做摇摆工作。对于 Win32,我推荐 Charles Petzold 所著的“Programming Windows”书籍。对于 Swing,请尝试 Core Java Vol. 1。我,由霍斯特曼和康奈尔。在掌握概念之前尝试这样做会令人沮丧且耗时。
The most obvious choice would be Swing, but don't expect to have a one-to-one mapping between Win32 GUI APIs and Swing.
In Win32 you have functions that use handles as object identifiers; in Swing you have a real OO GUI framework. Furthermore, the way events are handled is quite different.
To do the port you'll have to understand how Win32 & Swing work first. For Win32, I'd recommend the "Programming Windows" books, by Charles Petzold. For Swing, try Core Java Vol. I, by Horstmann & Cornell. Trying to do it before grasping their concepts will be frustrating and time consuming.