Customize Java Dialogue Color, Appearance, Theme

I want to make Java JDialog as shown in the picture (link below) using JDK 6 Swing. Is it possible? if you so kindly direct me. Image link: Image

+2


a source to share


2 answers


In java swing, this is called "appearance". You can change the look like this:

UIManager.setLookAndFeel(
        UIManager.getCrossPlatformLookAndFeelClassName());

      



The Sun has a great study and perception textbook that explains how it works.

I'm not sure which look and feel for what you are linking to, although you will have to find out.

+1


a source


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

  myDialog.getContentPane().add(someComponent);

      

and the color is

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

      



and choose a theme and go to your main program like

   nimbus, motif,windows,etc

      

Then the chosen look will change your theme.

+2


a source







All Articles