Results 1 to 8 of 8
  1. #1
    felito is offline Member
    Join Date
    Nov 2010
    Posts
    48
    Rep Power
    0

    Default jpanel background -java

    hi guys

    i have a simple dubt

    i need to replace this

    Java Code:
    panel[1].setBackground(Color.red);
    for an image, but i want to avoid a new jlabel for image, because i tested an i have another label inside this panel that is pushed to bellow

    thanks

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,702
    Rep Power
    8

    Default

    This seems like a job for google, but I'll start you off by recommending you read through this: Painting in AWT and Swing
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    felito is offline Member
    Join Date
    Nov 2010
    Posts
    48
    Rep Power
    0

    Default

    ? if i posted is because i done previously a google search. Your comment does not help me obviously

    I pointed out a specific problem

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,702
    Rep Power
    8

    Default

    Quote Originally Posted by felito View Post
    ? if i posted is because i done previously a google search. Your comment does not help me obviously

    I pointed out a specific problem
    I guarantee that a google search should yield some promising results, sample code, tutorials, etc. I even gave you the link to a tutorial.

    After reading through those, what did you find? What did you try? What worked, what didn't work? How didn't it work?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    felito is offline Member
    Join Date
    Nov 2010
    Posts
    48
    Rep Power
    0

    Default

    but i want to avoid a new jlabel for image, because i tested an i have another label inside this panel that is pushed to bellow
    i said that i already tried with a label! i did a search in google, but all solutions that I found are "label inside jpanel"

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,702
    Rep Power
    8

    Default

    Quote Originally Posted by felito View Post
    i said that i already tried with a label! i did a search in google, but all solutions that I found are "label inside jpanel"
    Okay... and did you read the tutorial I linked to?

    I'm going to be honest- your negative attitude really makes me want to not help you. I think I'm done with you.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    felito is offline Member
    Join Date
    Nov 2010
    Posts
    48
    Rep Power
    0

    Default

    if you cannot help do not post in response. Anyway Thanks for help
    Last edited by felito; 02-14-2011 at 07:26 PM.

  8. #8
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,702
    Rep Power
    8

    Default

    Quote Originally Posted by felito View Post
    if you cannot help do not post in response. Thanks for help
    The thing is, I absolutely could help. What you want to do is pretty trivial- which is why I suggested a google search first. I even gave you a link to a tutorial that should get you started. But instead of using those as jumping off points, you reacted like a child who didn't get a cookie. You don't take the time to form proper sentences (read the link in my signature on asking smart questions), but you want somebody to just hand over an answer. And if you had been polite and shown some effort, I probably would have just given it to you. But your attitude has caused me to decide against it. Good luck with that.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Can JDesktopPane can have a background JPanel?
    By chyrl in forum AWT / Swing
    Replies: 13
    Last Post: 10-22-2010, 06:56 AM
  2. Change JPanel background after its been set once
    By mevets in forum AWT / Swing
    Replies: 4
    Last Post: 04-14-2010, 01:07 AM
  3. background color with jpanel
    By hannerz06 in forum New To Java
    Replies: 6
    Last Post: 03-31-2010, 03:25 AM
  4. how to put a background image in a JPanel
    By yanipao in forum New To Java
    Replies: 5
    Last Post: 10-21-2009, 02:27 PM
  5. Set the background in Java
    By barney in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:13 AM

Posting Permissions

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