如何改善 JAVA swing GUI 的外观和感觉?
我正在开发一个使用 Java Swing 的项目。 Java Swing GUI 的默认外观非常无聊。有什么方法可以让我获得更好的外观和感觉吗?比如网页上的东西...
I am working on a project that uses Java Swing. The default look and feel of the Java Swing GUI is very boring. Is there any way I can use a better look and feel? Something like on web pages...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以设置外观来反映平台:
如果这对您来说还不够好,请查看 SWT对于 Eclipse。
You can set the look and feel to reflect the platform:
If this is not nice enough for you, take a look at SWT for Eclipse.
如果您擅长使用 Photoshop,您可以将 JFrame 声明为未修饰并创建您自己的图像,该图像将用作您的自定义 GUI。
在此示例中,将 JFrame 称为框架。
现在 JFrame 有了自己的边框和自定义 GUI,如果您定义了自己的自定义按钮用于最小化、最大化和退出,您需要在按钮上放置一个 JPanel 并声明这些按钮在操作侦听器函数中将执行的操作(哈哈抱歉...我不知道它是像c++那样称为函数还是类...)
例如,我们将 JPanel 称为面板,并且我们将设置一个退出按钮。
if you're good with Photo shop you could declare the JFrame as undecorated and create your own image that will server as your custom GUI.
in this example refer to the JFrame as frame.
now that the JFrame has its own border and custom GUI, if you defined your own custom buttons for minimize, maximize, and exit you need to lay a JPanel over the buttons and declare what those buttons will do in a action listener function(lol sorry...I don't know if it's called function like c++ or class...)
for example we will refer to the JPanel as panel and we will set up a exit button.