gpt4 book ai didi

java - JWindow 不出现

转载 作者:行者123 更新时间:2023-12-02 00:28:06 25 4
gpt4 key购买 nike

当我尝试将我的 JWindow 与 SeaGlass 一起使用时,它根本没有出现 Look and Feel ,即使我将其设置为可见。

import java.awt.EventQueue;
import javax.swing.UIManager;
import javax.swing.*;
import com.seaglasslookandfeel.*;
public class SEAGLASS {

public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(
"com.seaglasslookandfeel.SeaGlassLookAndFeel");

SEAGLASS demo = new SEAGLASS();
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

public SEAGLASS(){
JWindow window = new JWindow();

window.setVisible(true); //IT WAS NOT VISIBLE WHEN I RUN IT??//

window.getRootPane().setWindowDecorationStyle(JRootPane.NONE);
JButton bu1 = new JButton("MY BUTTON");
bu1.setBounds(100, 100, 120, 50);
window.getContentPane().add(bu1);
window.getContentPane().setLayout(null);
}
}

最佳答案

    window.setSize(500,500); // set it to a non 0 size!

关于java - JWindow 不出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9660525/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com