【问题标题】:How Can I customise the TitleBar of JDialog , JOptionPane?如何自定义 JDialog 、 JOptionPane 的 TitleBar?
【发布时间】:2019-05-02 18:24:44
【问题描述】:

有什么方法可以删除白色标题栏并将其更改为黑色?我正在制作自己的外观和感觉,我们如何更改它的颜色,以便所有具有标题栏的衍生物都应该有一个黑色的标题栏而不是白色的。

【问题讨论】:

  • 您找到解决方案了吗?
  • @EugenCovaci 是的,我正在寻找解决方案。我可以通过设置 setundecorated(true); 来删除标题栏;但不知道怎么变黑?
  • 如果没有其他办法,将其移除并在代码中添加(x)按钮和标题文本。无论如何都是静态的:)
  • @NenadVichentikj 非常感谢!如何添加按钮和标题文本?

标签: java swing paint titlebar


【解决方案1】:
class MyJDialog extends JDialog{

  public MyJDialog(){
     super()
     // add the text and button here including positioning
  }

}

【讨论】:

    猜你喜欢
    • 2012-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多