How to use an Image as JPanel's background

I want to use an Image as my JPane background, how can I do that? anyone will be kind to provide some sample code?
Thank you, please help
Emily

Do you want to tile the image or scale?
The simplest way I can think of would be to extend JPanel and override paintComponent(Graphics g) to either tile the image or to scale it over the panel.

Similar Messages

  • How to use an image as my form background in form central

    how to use an image as my form background in form central pls help me....

    Unfortunately this is not supported but you can submit a feature request on this form FormsCentral Ideas.

  • How to Use an Image to Customize the Static Button Widget

    Can I just get someone to help me figure out how to use an image to customize the static button widget, please?
    I have tried using several different types of images, but none of them seem to actually change the appearance of the button.
    Thanks!
    Laura
    Captivate 5.5

    I tried to use the tools within the widget itself - it offers you the opportunity to use an image (see screenshot below).
    I also opened it in Flash and tried to replace the images for one of the button styles there w/ my own, but in re-publishing the SWF from there I broke the widget.  When I attempted to use the edited widget, there were no customization controls available after I inserted it (see screenshot two below).

  • How to use the image manipulation palette to extract a part of an image

    How to use the image manipulation palette to extract a part of an image?I have a parent image from which i need to extract a certain sub part.can somebody pls help me on how to use this particular tool?
    Thanks

    Use the above snippet. You might need to convert the Image Type you are using with picture functions. The above snippet will give you good idea on how to achieve what you intend to.
    -FraggerFox!
    Certified LabVIEW Architect, Certified TestStand Developer
    "What you think today is what you live tomorrow"

  • How can I use an image as a folder background on icon

    vista updated firefox - how can I use an image as a folder background for an icon of that folder (for desktop)

    This is not a Firefox related issue or Firefox setting etc. This is a windows or OS setting, I provided the link below on how to change this in Windows Vista.
    See:
    '''[http://answers.microsoft.com/en-us/windows/forum/windows_vista-desktop/how-do-i-change-the-folder-icon-in-vista-to-one/01261170-4e02-4c4b-8c02-141d1524ad3e?auth=1]'''

  • How to use Picasa images

    On my Android, the program does not use the image provider. It tries to find folders with images, but fails. How can I use my Picasa images?
    R.G.

    I created an idea for this feature request here:
    http://forums.adobe.com/ideas/1090
    Feel free to vote on the idea and add comments for clarification if needed. Thanks
    -Dave

  • How to use 'transparant' images

    Hello,
    I'm very new to Illustrator so excuse me if I ask something which can't be done.
    In  Photoshop I have made a image where I removed the background, so that  the item is 'loose'  from the background (and the background is  transparant). I've saved the file as a PSD as well as a PNG.
    Now  I want to import that image in an Illustrator document but when I do  this, the transparant part of the image becomes white in Illustrator.
    Is there something which can be done so I can import an image with a transparant background?
    I hope my question is clear (as English isn't my original language).

    Well Mr. Jacob Brugge, to be honest.................than the problem is solved.
    Tsjjjjjjjj.....how simple.
    Thanks a million for this quick and correct reply.
    I really feel stupid (but I thought I had tried this before and than it didn't work, but probably I did something wrong then).

  • How can I extract image from complex (multycoloured0 background?

    How can I extract image from complex (multycoloured) shot?

    I would say either using the pen tool or the quick mask tool but without seeing how complex the image/background is I can't give you a complete answer...?
    Can you post the image?

  • How to use an image as button?

    I want to set an image as the background of a frame, and also want use four regions of the image as four buttons. How?

    How about an image on the JFrame with four JButtons with some type of image (even if you copy a piece of you original image to place on the button)? I played around with this and its kind of neat. Easier from a gui perspective to see buttons than flat regions -
    Have fun
    //in a class that extends JFrame, create the image panel and add buttons with icons to it...
    Container contentPane = getContentPane();
    ImagePanel imagePanel = new ImagePanel(); //see below
    contentPane.add(imagePanel);
    JButton button = new JButton();
    button.setIcon(new ImageIcon(WorldMap.class.getResource("someGIF.gif"))); //or other form of getting and setting an icon
    button.setSize(65,45);
    mcsButton.setLocation(405,175);
    mcsButton.setContentAreaFilled(false); //important so the button looks like a raised part of the picture...not a grey box with an icon.
    mcsButton.addMouseListener(new MouseAdapter()
    public void mouseClicked(MouseEvent e)
    //do something
    imagePanel.setLayout(null);
    imagePanel.add(mcsButton,null);
    //code to put an image on a JPanel I received from this forum
    class ImagePanel extends JPanel
    private Image image;
    public ImagePanel()
    image = Toolkit.getDefaultToolkit().getImage("C:/WholeWorldViewJPG.jpg");
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(image, 0);
    try
    tracker.waitForID(0);
    catch (InterruptedException e)
    public void paintComponent(Graphics g)
    super.paintComponent(g);
    Dimension d = getSize();
    int clientWidth = d.width;
    int clientHeight = d.height;
    int imageWidth = image.getWidth(this);
    int imageHeight = image.getHeight(this);
    g.drawImage(image, 0, 0, this);
    for (int i = 0; i * imageWidth <= clientWidth; i++)
    for (int j = 0; j * imageHeight <= clientHeight; j++)
    if (i + j > 0)
    g.copyArea(0, 0, imageWidth, imageHeight, i * imageWidth, j * imageHeight);
    }

  • How to use an image instead of Browse Button in messageFileUpload item

    Hi,
    I have sessageFileUpload item in my OA Page to upload files. How can I show my custom image instead of a Browse button that is placed by default. I don't want to show the browse button instead want to use my custom image.
    Thanks

    This is a framework object, you can't change that.
    --Shiv                                                                                                                                                                                                   

  • How to use custom images in Apex 4.1 with EPG

    I just ported over an application from Apex 3.2/10g using Apache to a new server using Apex 4.1/11g using EPG and none of my custom images work. When using Apache, all I had to do was copy the file over to the /i/Custom images folder and I could reference it on any of my pages. I copied the entire /Custom folder to the new server and that doesn't seem to do the trick. I've seen some posts that talk about having to use FTP (why?) or something to get this to work. Can someone please explain what is going on here and what I need to do to get this working?

    With EPG, the images aren't accessed from a directory. They are actually stored inside the database. The FTP process actually gets redirected so that the image gets stored inside Oracle rather than being written to a file. There are numerous articles and such detailing exactly how to do this.
    One is here:
    http://www.apex-blog.com/oracle-apex/accessing-i-using-ftp-170.html

  • How to use add image in HTML tag

    Hello frndz
                     i  m working on text chat application in adobe  air.using <mx:html/> tag for dispalying text and  images(smiley).but the font size fo flex is diffrent and html diffrent.i  mean i m using 10 font size but it looks too large on  <mx:html/>  component.is there any way to cast them in same size.
    The second and major problem is that it can not add images to html  tag.when i m giving images like:-private var txt:String="<img  src='src\smily\tongue.gif'/>" .
    it shows nothing but when i give images through http path it shows  images on html componenet.
    can any body explain me the problem.
    Thanks And regards
      Vineet Osho

    thanks Alot René Bühling for  your quick reply.but the link u mentioned ith reply is not working for  me.
    ok can u tell me how can i manage my flex font  size 10 to  <mx:html tag 's font size 10.
    i think there is large difference  between flex font and html font.so please guide me for that.
    Thanks  Alot
    Vineet osho

  • How to use the Image in document Tag (title).

    hi,
    I using Jdeveloper 11.1.1.3.0.
    I want to show the one image in title itself. which tag use to do this one.
    Regards,
    Ragu

    Hi Abhijit,
    when I click the new tab in firebox or IE and you enter the oracle website in the address bar. Now the new Tab place shows the title of oracle and Oracle Image. Like that i want.
    How to code in jspx file.
    I used the this tag <af:document id="d1" title="Oracle">. before oracle title i need one small image in jspx file.
    Regards,
    ragu

  • How to use backing store in JPanel?

    Below is a sketch of a class that extends JPanel. If I remove the variable "draw", the class works fine, except that the graphics drawing code is executed every time the parent window is fronted, resized, etc.
    I introduced the variable "draw" hoping that the call super.paintComponent(g) would use the backing store to refresh the display. Instead, the call simply erases the panel.
    How can I use the backing store?
    Thanks, for your help.
    public class DisplayPanel extends JPanel {
         boolean draw = true;
         public void paintComponent(Graphics g) {
             super.paintComponent(g);
             if (!draw)
                   return;
              // graphics drawing code here.
             draw = false;
         }

    Backing stores are only used on JViewpots. You will need to draw each time.

  • How To: Using Embedded Images for Drawing Fills

    I had some challenges making this seemingly simple feature work, so as I found no examples, I made an example on how to do this.  The key I found was using the “BitmapAsset” class which is compatible with posting our embedded image into BitmapData objects. That put things together.
    See the full narrative at:  http://digitalshowcase.biz/wordpress/?p=234
    Download the Flex Project here:  http://digitalshowcase.biz/flex/FillsWithEmbeddedImages.zip
    - Alan Gruskoff, Digital Showcase LLC

    >>says that this export technique does not work, it produces a low res screen version of the file.
    Are you certain the original files were any better?
    My preferred method of doing this works well, but it takes a few extra steps. I'd make a high-res PDF out of the PM file, then pick apart the PDF to extract the graphics. Are the graphics raster or vector? If they're raster, you can use Acrobat's Touch-up Object tool to open them in Photoshop. If they're vector, you can open the PDF in Illustrator and save out the graphics from there.
    HTH

Maybe you are looking for

  • Cross-reference does not work inside the object states

    Hi All, I use InDesign CS5.5. I have four pages document. first three page has full for text and the fourth page has multi-state object. I am trying to insert the cross reference from the third page to the multi-state object (fourth multi-state objec

  • SQL Developer tool sometimes does not display data with date type

    run the following query using the sql developer tool - select effective_date from table1 where id = 123; (the effective_date is stored in the database as date.) one record is returned with no date in the filed. However, if I change the query to selec

  • Inactive plot annotation

    Hi all, I have multi-plot graph with annotation that displays the value. There is an option to sort the plot and make only one plot active at time. Although the inactive plot is invisible, annotation still reads from inactive plot when I click there

  • Compressor refuses to launch - Catch-22

    I took delivery of a brand new Quad-core system with FCP Studio 2 installed by a large local authorized Apple dealer. FCP works fine, usually. Finished editing a project last week and need to compress it (90 minute HDV documentary) to create a DVD. U

  • ORDRSP Idoc addition and deletion of segment schedule lines

    Hello I have requirement in the Iodc ORDRSP it has segment E1EDP01 and it has sub segments E1EDP02 E1EDP03   E1EDP05 E1EDP20 E1EDP20 And it has multiple E1EDP20 with the different quantity Now I if there are more than one E1EDP20 segments and  should