3 Replies Latest reply on Oct 9, 2004 3:09 AM by camickr

    background image

      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
          probably, but you will have to elaborate a little more, I am afraid I cannot quite understand what you want.
          • 2. Re: background image
            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
              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.