将任意几何变换应用于 JPanel
我在 JPanel 中有一些 Swing 控件。我希望这个面板出现在通过某种任意仿射变换变换的屏幕上,并且所有控件都保持交互式。例如,我们假设旋转 20 度并缩小到正常尺寸的 75%。
我见过的最接近如何执行此操作的方法如下: http://www.coderanch.com/t/ 343261/GUI/java/应用仿射变换-JPanel (但不幸的是,这个解决方案不会导致控件交互)
还有这篇文章: http://coding.derkeiler。 com/Archive/Java/comp.lang.java.gui/2004-02/0719.html (似乎没有一个完美的解决方案,但也许现在(6 年后)事情已经发生了变化)
I have some Swing controls in a JPanel. I want this panel to appear on the screen transformed by some arbitrary affine transformation, and for all the controls to remain interactive. Lets assume a rotation by 20 degrees and a scale down to 75% normal size for example.
The closest I have seen for how to do this is here:
http://www.coderanch.com/t/343261/GUI/java/Applying-affine-transform-JPanel
(but unfortunately this solution does not result in the controls being interactive)
Also there is this post:
http://coding.derkeiler.com/Archive/Java/comp.lang.java.gui/2004-02/0719.html
(for which there did not seem to be a neat solution, but perhaps now (6 years on) things have changed)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 JXLayer 来实现这一点。更多信息请访问 http://www.pbjar.org/blogs/jxlayer/jxlayer40/< /a>
You can use JXLayer for that. More info is at http://www.pbjar.org/blogs/jxlayer/jxlayer40/