How do i insert an image on a panel or anything?

so for example i already have this
          Toolkit tkit=Toolkit.getDefaultToolkit();
          icon = tkit.getImage(ClassLoader.getSystemClassLoader().getResource("images\\icon.gif"));
how do i insert it to let's say
Panel Panel1 = new Panel();
or label?
Label Label1 = new Label(");

hi,
the best way is to write a class extending panel/label. this class needs to have it's own paint-method. within this paint(), you can draw your image
an example
import java.awt.*;
public class myPanel extends Panel{
private Image icon=null;
public myPanel(Image icon){
  this.icon=icon;
public void paint(Graphics g){
  g.drawImage(icon, 0, 0, this); // this is the ImageObserver
}may this helps
regards

Similar Messages

  • How do I insert an image in G-mail using firefox 6.0.1??

    I am using g-mail in firefox browser 6.0.1. My operating system is win 7 64-bit. Question: how do I insert an image in g-mail??

    Nevermind figured it all out once I walked away!

  • How do I insert an image into a quetsion (post)

    What are Mozilla code-structure in new posts.?
    How do I insert an image into a new post?
    Thank you

    cor-el said
    If the image is on another server then we prefer to have a link instead of the real image in case it is a large image and we've already seen it or do not want to wait for it to load (server may be slow).
    I do not know what any of this means.
    I have a single laptop connected to the internet.
    So far I have worked out how to upload an image to a thread-reply by copying the uploaded file "path" and pasting it onto the reply
    and then after the reply is posted there are two incidence of each image
    1. the URL
    2. the image at the bottom of the reply
    I am a newbie so would appreciate any feedback
    (Firefox window controls have disappeared (Clean installed v18 5 days ago). Have logged another thread/reply on this forum)
    Thanks

  • How do you insert an image into a google map using a macbook?

    I am trying to put images into a Google map using my MacBook, but cannot seem to find any help. How do I insert an image into my Google map using my MacBook?

    Nothing complicated with your menu - very clear "ADD Image" but my menus are not as simple. Everytime I need to add an image I spend 5-10 minutes searching again. Wonder why so hard. I generally find Acrobat menus cryptic and unclear and I am big Adobe fan - use Illustrator, Photoshop, Dreamweaver, Premier, Fireworks etc - but Acrobat menus are like calculus in the dark.

  • How can I insert and image in all PDFs printed via BW?

    How can I insert and image in all PDFs printed via BW?
    We want to remove the image from all Web Templates and insert it in the header of PDF printouts.
    <removed by moderator>!
    Tom
    Edited by: Siegfried Szameitat on Dec 3, 2008 2:57 PM

    Select clip in timeline. Open effects. At the bottom, search for flip. This should find the "Flipped" effect. Drag that effect cover the clip.

  • How can I insert an image into a cell in Numbers for iPad?

    Hi,
    is there any way to insert an image inside a cell using Numbers for iPad? I tried doing it on desktop version and it works, then I shared it through iwork.com and downloaded into my iPad and it's showing fine on the iPad ( although there's no way to edit or change the image inside the cell ) but when I try to do the same task on iPad itself, the image always comes floating even if I place the cursor inside a cell before inserting.
    any idea how to do it or if it's even possible?
    thanks.
    John

    Images can be added to cells only as "image fill." Cell fill is an attribute of the cell, not content of the cell. Only cell content can be retrieved by a formula or by copying the content of the cell.
    Copying the cell will also copy its format, including the image fill, but I've found no way to extract the image from the cell.
    Regards,
    Barry

  • How do I insert several images at the same time?

    I'm wanting to insert several images onto a page. How do I do that? It only allows me to insert one at a time and I have over 100.

    If this is a once off exercise, you can speed things up in DW in Code View if you insert the code by hand.
    If the structure is identical (e.g. in a table), you can easily cut-and-paste the repetitive code and change the name of each file to suit.
    For example:
    <table>
    <tr>
    <td>image1.jpg</td>
    <td>image2.jpg</td>
    <td>image3.jpg</td>
    <td>image4.jpg</td>
    <td>image5.jpg</td>
    </tr>
    </table>
    However if you're doing this continually, as Nancy says, sounds like you might be better off with a 3rd party dedicated photo gallery tool or Dreamweaver extension, with a very efficient, automated front end for large numbers of images, whose code output you can insert into the Dreamweaver.
    There are plenty out there.

  • How do I insert an image in a div box?

    OK I've got a seemingly small issue I have to iron out to update our homepage after our graphics person decided to stop showing up to work.  If you need to view the page source it is located here - http://www.rugged-cctv.com/indextestvideo2.shtml
    1. In the image listed below on the red title of the youtube video I have inserted a Rugged Cams logo image that needs to appear like it does in the image. It also shows up correct in the live view of DW  When uploaded the actual page just lists the alt text.  I would also like to center the text in the middle of the image instead of at the bottom of it.   How do I get the image to actually show up? and center the text vertically on the Rugged Cams logo?
    Here is the code for the container it is in and that div.
    <div id="youtubecontainer" style="overflow: hidden;">
    <div id="youtube" style="float: left; color:red; width: 475px; padding-left: 0px; font-family:Britannic Bold; font-size: 22px; text-indent: 5px;"> Businesses & Dealers Love the <img src="images/ruggedcams.jpg" width="66" height="34" alt="RuggedCams" /> brand
    <object height="370" width="460">
      <param name="movie" value="http://www.youtube.com/v/3aysc6dGh3c?fs=1&hl=en_US"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/3aysc6dGh3c?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="370" width="460"> 
      </object>
    <!--end youtube--></div>

    Nevermind figured it all out once I walked away!

  • How can I insert a image into a BLOB column in a table?

    I am using forms6i against a 10gR2 database and I have one table with a BLOB column and I try to insert a image into this column. I get ORA-01461 error.
    The curious case is that in another table with a BLOB column it works very fine.
    What happens with the first table? How can I avoid the error?
    Thanks in advance.

    Hi hyue,
    Thanks for visiting Apple Support Communities.
    If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
    iMovie for iOS (iPad): Add photos to a project
    http://support.apple.com/kb/PH3171
    All the best,
    Jeremy

  • How do I insert an image within an email message, instead of attaching it?

    I'm always receiving emails with images right in the email message but when I send an image with an email message I always have to send it as an attachment because I don't know how to put the image right in the email message.

    RobSJacobs2411 wrote:
    It seems that it has to be on your server or computer to insert an image.
    That's how DW was designed initially and, for standard websites, that works very well. Unfortunately DW has never been great for email newsletters and its handling of external image links has always been spotty to bad depending on what you're doing.
    For html emails, I normally work with local versions of the images until it's time to "go live", then I swap out the image sources from local to the ones on the server as the last step from Code View.
    It's not ideal, but it works better than trying to get the http links to display the images correctly without opening/closing the file or program repeatedly.
    Adding your voice to the Bug Report/Feature Request form could help future releases of the program...
    Adobe - Feature Request/Bug Report Form

  • How can I insert an image at the original resolution into a PDF using Acrobat Pro XI

    Got an image created in Photoshop at 300DPI 2480 pixels wide by xx high.  Saved as a TIFF.
    When I insert that image in my PDF (A4 210mm x 297mm) using Acrobat Pro XI via "Content Editing->Add Image" it appears smaller than the page width of the PDF, and I must manually resize the inserted image by dragging with my mouse.  
    Documentation says the image is inserted at the original image resolution, but it doesn't seem to be the case.
    Also tried creating another image in Photoshop using 210mm width @ 300 DPI (instead of 2480 pixels @ 300DPI), got the same results.
    Can anyone help?  Cheers.

    You should maybe take a step back. Nobody composes pages in Acrobat.

  • How can I insert an image into an mov file in iMovie while keeping the background music?

    I have a short MOV file movie clip that has background music but one of the images (it's a static element with text) is incorrect. How can I replace the image but keep the backgroup the same? Also what size would the image need to be to properly fit?
    Thank you!

    Hi hyue,
    Thanks for visiting Apple Support Communities.
    If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
    iMovie for iOS (iPad): Add photos to a project
    http://support.apple.com/kb/PH3171
    All the best,
    Jeremy

  • How do I insert an image into a Form

    I want to insert an image into a form. This field will change each time I start a new form. I'm creating an invoice for a customer and they want to insert an image of the house they are working on. Each time they start a new job, they need a new invoice, needing a new image. Can the client inset a jpeg that they have on their computer? Please help!!

    If they have a full version of Acrobat, then you could set up a button field from the Forms menu and set it to accept an icon only. They would need to have some knowledge of Acrobat but it could be done.

  • How do I insert an image into a Frame?

    Hi!
    I need to insert an image into a Frame(java.awt.Frame) and I can't use swing, I need to use only awt.
    Witch class do I use to insert an image?
    Using swing I used a JLabel and the setIcon method. But now I can use only AWT.

    Out of curiosity, why are you limiting yourself to AWT? Why not use Swing / JFrame, etc..
    I think this is a situation where answering your direct question is the wrong way to go. Perhaps its more of a design question that needs to be addressed.
    Message was edited by:
    petes1234

  • How do I insert multiple images inline with text in Pages 5.0?

    I have over 20 images in my iPhoto library that I want to insert in a document one after the other (inline with text).
    How do I do this without having to insert them one by one and going into the image options to change the formatting? It's a pain to have to do it this way...
    I tried using the media browser in Pages, but it seems you can only add them one by one. So I exported the pictures from iPhoto into a folder, selected them all in Finder and dragged them onto my document. All the images appeared stacked on top of each other in a random spot on my page. I can't select them all for some reason. So again, I have to click on them one by one to the formatting? Why is this not simpler? Am I missing something?

    If you use the Help in your Pages 5 you will find the followings link http://help.apple.com/pages/mac/5.0/?lang=en#/tanca246d3ac

Maybe you are looking for