Results 1 to 8 of 8

Thread: java app

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Posts
    118

    java app

    Hi all,

    I am using NetBeans IDE, try to develop a simple java application. In the JFrame's properties, I tried to set the background to a diffrent color. It doesn't allow me to do so. It always goes back to the default color which is gray.

    Can anyone help me on this.

    Thanks in advance.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: java app

    Sometimes NetBeans does crazy things, copy the part of the code that changes the color and paste it at the end of the initComponents(), this might make it work
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: java app

    How are you setting the background?

    It should work when you do:

    getContentPane().setBackground(Color.blue);

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Posts
    118

    Re: java app

    I set the color in the JFrame's properties.

  5. #5
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: java app

    Quote Originally Posted by AlnavPlatinum
    I set the color in the JFrame's properties.
    Okay, did you try this;

    getContentPane().setBackground(Color.blue);

  6. #6
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: java app

    Quote Originally Posted by System_Error
    Okay, did you try this;

    getContentPane().setBackground(Color.blue);
    it's useless, he only want to do it using netbeans frame properties
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  7. #7
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: java app

    Quote Originally Posted by ComputerJy
    it's useless, he only want to do it using netbeans frame properties
    Oh well, it's his loss I guess

  8. #8

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Posts
    118

    Re: java app

    Yes I did, and it works really well. Thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width