Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Look And Feel Decorations in ... not-Stand-Alone Applications

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Location
    Romania
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question 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 :

    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, ...
    I`m very confused ...

    Thank you everyone in advance !
    System.out.println(Signature.getSignature());


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default 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.

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Location
    Romania
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default 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 ?
    System.out.println(Signature.getSignature());

Similar Threads

  1. Writing java applications for the iPod Touch
    By JavaPF in forum Java ME (Mobile Edition)
    Replies: 8
    Last Post: June 14th, 2011, 05:34 PM
  2. Replies: 8
    Last Post: August 6th, 2009, 02:35 PM
  3. Applications of OOPs
    By sriraj.kundan in forum Object Oriented Programming
    Replies: 5
    Last Post: June 21st, 2009, 11:25 PM