如何在不同的操作系统之间左对齐JFrame标题文本 [英] How to left align JFrame Title text between different OSs

查看:90
本文介绍了如何在不同的操作系统之间左对齐JFrame标题文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来操作系统正在控制整个JFrame标题栏. 我尝试使用:

It looks like the OS is controlling the whole JFrame title bar. I tried using:

UIManager.setLookAndFeel()

更改外观,但这似乎并没有影响 标题栏.

To change the Look and Feel, but it doesn't seem to affect the title bar.

在Windows计算机上,默认设置为左对齐,但在Linux上为默认设置 机器居中,以某种方式,我想尝试始终显示 标题文本左对齐.

On my Windows machine the default is left aligned, but on my Linux machine it's centered, and somehow, I'd like to try to always show the title text left aligned.

我看到了一个例子,他们基本上构建了每个元素 从头开始的标题栏,而我宁愿不去那里.

I saw one example where they basically built every element of the title bar from scratch, and I'd rather not go there.

还有其他方法吗?

谢谢!

推荐答案

如果L& F支持窗口装饰,则可以使用此处引用了一个完整的示例.

If the L&F supports window decorations, you can use setWindowDecorationStyle(). A complete example is cited here in UIManager Defaults.

这篇关于如何在不同的操作系统之间左对齐JFrame标题文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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