L形java应用程序窗口
我想创建一个“L”形状的java应用程序,以便该应用程序仅占据屏幕的左侧和底部边框。我也不希望顶部有正常的边框和标题栏。我见过其他人创建圆形和其他类似的形状,但没有复杂的形状。这是针对 Windows XP 计算机的,绝不会在任何其他操作系统上使用。
那么,我该怎么做呢?
I want to create a java application that is the shape of an "L" so that the application only occupies the left and bottom borders of the screen. I also do not want the normal borders and title bar at the top. I've seen other people creating circles and other shapes like that, but no complex shapes. This is for a windows xp computer and will never be on any other os.
So, how would I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
java.awt.Window
/javax.swing.JWindow
和java.awt.Frame
/javax.swing.JFrame
> 使用setUndecorated
将创建无框窗口。您可以将两个或多个组合在一起形成 L 形。从6u10开始,Sun JRE还具有非标准API或非矩形和透明窗口。
java.awt.Window
/javax.swing.JWindow
andjava.awt.Frame
/javax.swing.JFrame
withsetUndecorated
will create frameless windows. You could put two or more together to create an L-shape.From 6u10, the Sun JRE also has a non-standard API or non-rectangular and transparent windows.
我认为这应该是可能的,尽管您可能必须小心布置组件。如果您查看此处,并阅读有关设置 a 的形状的部分窗口显示以下内容“形状可以是 java.awt.Shape 接口的任何实例”。如果您随后查看 Shape 接口,就会发现 java.awt.Polygon 实现了该接口。所以你应该能够实现一个带有“L”形状的多边形。试一试。
I think this should be possible, although you would probably have to be careful about laying out your components. If you look here, and read the Section on setting the shape of a window it says the following "The shape can be any instance of the java.awt.Shape interface". If you then look at the Shape interface, java.awt.Polygon implements that interface. So you should be able to implement a polygon w/ a "L" shape. Give it a shot.
在这里,Asa,这正是您所需要的:
参考 -> “设置窗口的形状”
Here you go Asa, this is exactly what you need:
reference -> "Setting the Shape of a Window"