当我尝试在SeaGlass Look and Feel中使用我的JWindow时,它根本没有出现,尽管我将它设置为可见。
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);
}
}发布于 2012-03-12 09:09:44
window.setSize(500,500); // set it to a non 0 size!https://stackoverflow.com/questions/9660525
复制相似问题