Look And Feel Decorations in ... not-Stand-Alone Applications
Hello getName(); ! :)
My problem is this : I can`t set the look and feel decoration.
I used the "setDefaultLookAndFeel(boolean b);" method, sometimes it`s decorated, but the graphical content isn`t displayed, and sometimes it`s not. Here is what I mean :
Code :
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JDialog;
import javax.swing.JFrame;
public class Deco extends JFrame{
public Deco(){
JDialog.setDefaultLookAndFeelDecorated(true);
//If setDefaultLookAndFeelDecorated(true); is here,
//nothing happens...
setTitle("Deco");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400, 400);
setBounds(450, 220, 400, 400);
setResizable(false);
setVisible(true);
}
public static void main(String args[]) {
// And if setDefaultLookAndFeelDecorated(true); is here,
// the frame is decorated depending on the look and feel.
new Deco();
}
public void paint(Graphics g){
g.clearRect(0, 0, getWidth(), getHeight());
g.setColor(Color.LIGHT_GRAY);
g.fillRect(0, 0, getWidth(), getHeight());
}
}
I think it`s because of those statemenets with fill/clearRect... but I`m not sure, :confused: ...
I`m very confused :confused: ...
Thank you everyone in advance !
Re: Look And Feel Decorations in ... not-Stand-Alone Applications
Take a look at this: setDefaultLookAndFeelDecorated
It's some side effect of having that method declared static, I think.
Re: Look And Feel Decorations in ... not-Stand-Alone Applications
Uhh... the link led me to a page of products and tehnologies from sun, how would that help me ? :-/