开发者

customize Java dialog Color, Appearance, Theme

I want to make Java JDialog appear like it is presented in the image (link below) using JDK 6 Swing. Is it possible? if so kindly guide me. Image 开发者_Python百科Link: Image


Yes, It is possible. You can add your component is,

  myDialog.getContentPane().add(someComponent);

and the color is,

   myDialog.getContentPane().setBackground( Color."YourColor");

and select the theme, and set into to your main program like,

   nimbus, motif,windows,etc

Then the selected look and feel will be chang your theme.


In java swing this is called the 'look and feel'. You can change the look and feel as follows:

UIManager.setLookAndFeel(
        UIManager.getCrossPlatformLookAndFeelClassName());

Sun has a large Look and feel tutorial that explains how this works.

I'm not sure which look and feel you are linking to though, you'd have to find that out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜