3 Replies Latest reply: Oct 8, 2004 10:09 PM by camickr RSS

    background image

    807587
      Hello!
      I want to build an aplication without using a JFrame. Instead I want to use an image as background. This image is not rectangular. I don't want to be painted pixels out of the image. I tried to use a Window ant set it not opaque and rewriting its paint method but it paint the background color although I leave the paint method empty. Anyone knows how to make this?

      Best regards
        • 1. Re: background image
          807587
          probably, but you will have to elaborate a little more, I am afraid I cannot quite understand what you want.
          • 2. Re: background image
            807587
            I've done this. Easiest way: Make a component that overrides JPanel. Have it paint the image into itself during the "paint(...)" function. Then set that component to be the content pane of a JFrame via "frame.setContentPane(picturePanel);". From there use the JFrame as normal.
            • 3. Re: background image
              camickr
              The words from your topic "background image" would be two great keywords to search the forum with. Try it. You'd be amazed how many times this question has been asked before.

              Get in the habit of searching first and asking questions second.