Insert  a  Picture Into a Panel....

How can i insert a picture into a JPanel.
Actually I want to show the picture only to the left hand side of the
JFrame.
Kindly help me.
Thanx

I would suggest to use a JLabel instead of JPanel.
And then go ahead like described in the other tips.
The JLabel can then be placed whereever you want inside your frame.
Btw. if you just need something like a dialog - with a label to the left side, few buttons and some objects inside - I recommend to read the tutorials for JOptionPane - it is much easier to use this class instead of doing all the code on your own.

Similar Messages

  • How do I insert a picture into iMovie regardless of aspect ratio

    When I insert a picture, i either have the choice of cropping the picture or having black bars on the sides. How can I insert a picture into imovie and not be dictated based on the aspect ratio. thanks

    Klaus1 wrote:
    Must be one of the wonderful improvements introduced in iMovie 11.
    nope, never.
    look:
    example #1: a 1:1 pic in a 16:9 screen
    option A bars l/r
    option B cat-off
    example #2: a wiiiide screen pic in a 16:9 screen
    option A bars t/b
    option B catcut off
    and you don't want kitty look like that:
    (1:1 aspect ratio distorted to make fit onto a 16:9 screen)

  • Acrobat form field that allows Reader user to browse and insert a picture into a predefined area

    Is there a way to do insert a form field into an AcroForm that allow Reader users to browse and insert a picture into that form field?
    I know that LiveCycle can do this, but I need to do this using an AcroForm. Or maybe there's a third-party plug-in that can be used in an AcroForm to do this?

    Jay,
    The new version of Reader, which was announced today (see AcrobatUsers.com), will now allow you to use the field.buttonImportIcon method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.737.html
    For a bit more information, see: http://forums.adobe.com/thread/743823
    Here's the minimum code that can be used in the Mouse Up event of a button that's configured with a layout that's something other than "Label only":
    // Mouse Up script for a button
    event.target.buttonImportIcon();
    Since this isn't backwards compatible with Reader, you'll probably want to add additional code to test what version is being used and alert the user if it's pre-11. You should also check the return value to see if anything went wrong. The hard part is getting everyone to upgrade, but this and a number of other features should make it worth it.

  • Insert editable picture into PDF form?

    Good day,
    I am creating editable marketing flyers for a client.  I'm opening my PDF (originally created in Illustrator) in Acrobat and adding editable form feilds for the end user to add their contact information to each piece.  The enduser also wants to add a photo with their contact info.  Is there a way to create this as part of the form?  Ultimately, I'm wanting them to be able to insert a picture into a specified area and not have to resize the photo.  Is this possible in Acrobat professional?
    Any information would be greatly appreciated!  I'm working in CS3 and Acrobat 8, on a mac.
    Cheers,
    Lilly

    This post has been invaluable for me! Thanks for everyone input. I have used the event.target.buttonImportIcon(); javascript to create PDF's the user can import, and it works great. However I now have on last challenge and I am hoping someone on this forum can help out with. Is there anyway (with a little javascript on the button) to have the image the user uploads flip upside down? I have a document that needs to be folded in half, and it would be perfect if I could have the user upload the image to both buttons, but have one button flip the image upside down. I know I could have the user do that image flipping and re-saving on their own, but I am trying to simplify things. Any ideas here would be helpful.
    Thanks!

  • How do you insert a picture into an iMovie video?

    how do i insert a picture into an iMovie video?   (i know it's simple and i've done it before, but i can't figure it out now )

    Just drag it onto the Project timeline  From iPhoto or outside of iMovie...
    rick

  • How do you insert a picture into another picture?

    How do you insert a picture into another picture.  For example, one person is missing from family photo & I'd like to insert that person's face.

    By using an external editor:
    In order of price here are some suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate. You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How do i insert a picture into a table cell

    hi
    i am trying to insert a photo into a table cell in Pages of iPad.
    how do i do that?
    thanks

    I have this question too. It is very important for me to insert pictures into tables in order to complete my lab reports. This feature needs to be added; the software is useless without it. It is things like this that make me regret Apple purchases.

  • Insert a Picture into the Picture/Image Content Control using Open XML SDK 2.0

    I have created a word template as follows
    Here PizzaPicture is a Picture Content Control, PizzaName is a Plain Text Content Control and PizzaDescription is a Rich Text Content Control
    I am able to assign text to PizzaName and PizzaDescription Easily but not able to even locate the PizzaPicture. Here is my code
    using (WordprocessingDocument document = WordprocessingDocument.Open(@".\test.docx", true)) {
    MainDocumentPart mainPart = document.MainDocumentPart;
    DocumentFormat.OpenXml.Wordprocessing.Text text = null;
    SdtContentBlock pizzaNameBlock = null;
    SdtContentBlock pizzaDescriptionBlock = null;
    //SdtContentBlock pizzaPictureBlock = null;
    List<SdtBlock> sdtList = mainPart.Document.Descendants<SdtBlock>().ToList();
    foreach (SdtBlock sdt in sdtList)
    Console.WriteLine(sdt.SdtProperties.GetFirstChild<Tag>().Val.Value);
    SdtBlock s1 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaName").Single();
    SdtBlock s2 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaDescription").Single();
    SdtBlock s3 = mainPart.Document.Body.Descendants<SdtBlock>().FirstOrDefault(r =>
    SdtProperties p = r.Elements<SdtProperties>().FirstOrDefault();
    if (p != null)
    Console.WriteLine("P is not null");
    // Is it a picture content control?
    SdtContentPicture pict =
    p.Elements<SdtContentPicture>().FirstOrDefault();
    if (pict != null) Console.WriteLine("Pict is not null");
    // Get the alias.
    SdtAlias a = p.Elements<SdtAlias>().FirstOrDefault();
    if (pict != null && a.Val == "PizzaPicture")
    return true;
    return false;
    if (s3 == null) {
    Console.Write(" s3 is Null");
    } else {
    Console.WriteLine("s3 not null");
    if (s1 != null) {
    pizzaNameBlock = s1.Descendants<SdtContentBlock>().FirstOrDefault();
    text = pizzaNameBlock.Descendants<DocumentFormat.OpenXml.Wordprocessing.Text>().FirstOrDefault();
    // here you can set the current time
    text.Text = "Peperoni";
    Console.WriteLine(text.Text);
    string embed = null;
    if (s3 != null)
    Drawing dr = s3.Descendants<Drawing>().FirstOrDefault();
    if (dr != null)
    Blip blip = dr.Descendants<Blip>().FirstOrDefault();
    if (blip != null)
    embed = blip.Embed;
    if (embed != null)
    IdPartPair idpp = document.MainDocumentPart.Parts
    .Where(pa => pa.RelationshipId == embed).FirstOrDefault();
    if (idpp != null)
    ImagePart ip = (ImagePart)idpp.OpenXmlPart;
    using (FileStream fileStream =
    File.Open(@"c:\temp\pepperoni.jpg", FileMode.Open))
    ip.FeedData(fileStream);
    if (s2 != null) {
    pizzaDescriptionBlock = s2.Descendants<SdtContentBlock>().FirstOrDefault();
    string altChunkId = "AltChunkId12345";
    AlternativeFormatImportPart chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.Xhtml, altChunkId);
    chunk.FeedData(File.Open(@".\html.txt", FileMode.Open));
    AltChunk altChunk = new AltChunk();
    altChunk.Id = altChunkId;
    ////Replace content control with altChunk information
    OpenXmlElement parent = pizzaDescriptionBlock.Parent;
    parent.InsertAfter(altChunk, pizzaDescriptionBlock);
    pizzaDescriptionBlock.Remove();
    mainPart.Document.Save();
    document.Close();
    Here the call mainPart.Document.Descendants<SdtBlock>().ToList(); returns me only 2 items PizzaName, PizzaDescription but
    no PizzaPicture.
    Secondly the line   SdtContentPicture pict =  p.Elements<SdtContentPicture>().FirstOrDefault();
    returns NULL. So it seems that there is no element of type SdtContentPicture.
    What am I doing wrong? I am pretty sure that I have put PizzaPicture as a Picture content control.
    My objective is to locate this control in the document and then insert an image into it programmatically.
    MSDNStudent Knows not much!

    Hi,
    I'm running some test on your code, and I'll come back as soon as I get some update. But before that, I would recommend you to bind customXMLPart with the content controls via Content Control Tool Kit,
    which enables us to bind customXMLPart with CC by dragging and dropping.
    After binding, you can change contents of the template via OpenXML SDK easily as the following code:
    private void button1_Click(object sender, EventArgs e)
    string fileName = @"C:\CCTest.docx";
    WordprocessingDocument wordDoc = WordprocessingDocument.Open(fileName, true);
    MainDocumentPart mainPart = wordDoc.MainDocumentPart;
    CustomXmlPart customPart = mainPart.CustomXmlParts.FirstOrDefault();
    //convert image into string
    string picName = @"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg";
    System.IO.FileStream fileStream = System.IO.File.Open(picName, System.IO.FileMode.Open);
    System.IO.BinaryReader br = new System.IO.BinaryReader(fileStream);
    byte[] byteArea;
    byteArea = br.ReadBytes(System.Convert.ToInt32(fileStream.Length));
    string picString = System.Convert.ToBase64String(byteArea);
    //Load the XML template
    string DataString = Properties.Resources.XMLData;
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.LoadXml(DataString);
    //change the value
    XmlNodeList xmlNode = xmlDoc.GetElementsByTagName("pizzaPic");
    xmlNode[0].InnerText = picString;
    xmlNode = xmlDoc.GetElementsByTagName("pizzaName");
    xmlNode[0].InnerText = "Pizza Name";
    xmlNode = xmlDoc.GetElementsByTagName("pizzaDescription");
    xmlNode[0].InnerText = "Pizza Description";
    //write the custom xml data into the customxmlpart
    System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(customPart.GetStream(System.IO.FileMode.Create), System.Text.Encoding.UTF8);
    writer.WriteRaw(xmlDoc.InnerXml);
    writer.Flush();
    writer.Close();
    fileStream.Close();
    br.Close();
    mainPart.Document.Save();
    wordDoc.Close();
    and the XML template of the project would something like:
    <?xml version="1.0"?>
    <Pizza xmlns="http://Test/ContentControls/Pizzas">
    <pizzaPic></pizzaPic>
    <pizzaName></pizzaName>
    <pizzaDescription></pizzaDescription>
    </Pizza>
    I hope this helps.
    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

  • I want to insert a picture into a body of text in a blog entry page.

    This has me stumped. I did it once but cannot do it again.
    How can I place a picture into a body of text? I have a print-out from the HELP menu but it is not clear. It talks of inline and fixed objects. I think I want a fixed object -- one that does not move along with the text as the text grows/moves along the page incrementally.
    Because I am working with the photo on a blog entry page I cannot do the Choose Insert > Choose > Select the file, and click insert. I cannot because (1) The picture has to stay on the page in that Magic Frame, and (2) the choosing capability of the iWeb program does not enable someone to go inside the iWeb program and land on a certain page.
    I am working on the blog page. Instead of a tiny little picture of a doll at the top of the page, I want to raise all of the text and put the little doll's head inside the text body.
    I am so stumped. The instructions are not clear at all.
    Lorna in Southern California
    Fri, Sep 15, 2006 11:52 PM PST

    Well i did exactly what your trying to do...go to
    http://www.mac-switch.com
    and view the blog "power button shortcut"
    Go to the section you want to add the photo
    to...Click "insert" then "choose" and choose the file
    you want to put in there.
    Good luck
    Rob.
    Hi Rob......
    You know, I went to that Power Button Shortcut blog and for the life of me, your point went flying over my brains -- I just did not get what point you were making to me. The Power Button thing was not what I was trying to do. I was trying to put a PICTURE of a doll's head inside a body of text. That means I had to get text wrap to kick in, and..........
    But the bottomest line is, I finally did it. I don't know how I did it because I was in a state of just clicking around, trying to move text. It's a long story to duplicate, but I went through several steps and since it was just desperation moves I was doing, I don't have a set of notes to go by for the next time.
    The hard part, or one of them, was to get the Text Inspector to make he Text Wrap workable. For a long time , no matter what I did, the Text Wrap option remained greyed out. It was maddening. Then for reasons that I cannot recreate in an orderly fashion, I got the Text Wrap option to get bolded out, and thus an option.
    Thank you for trying. BTW, I think your pages look wonderful and very slick (which I think is the right look for what you want to do with your website).
    Lorna in Southern California

  • How can I insert a picture into a AbsoluteLayout ?

    Hi everybody.
    I am using a null layout and I don't know how to insert a picture.
    public static void addComponentsToPane(Container pane) {
            pane.setLayout(null);
           JButton b1 = new JButton("one");
           /* ... the rest of the elements...*/
          pane.add(b1);
         Insets insets = pane.getInsets();
         Dimension size;
         size = b1.getPreferredSize();
            b1.setBounds(250 + insets.left, 40 + insets.top,
                         size.width , size.height);
       /* and the rest of the program with createandshowgui and main */Can I do with a picture the same thing that I did with this button (setBounds etc?)
    If yes, how can I do that?

    blackblack13 wrote:
    Thanks for the answer but why you say no to use null layout?what is the disadvantage?The disadvantages are having an app that is completely inflexible and does not adapt well to different operating systems and desktops. Please read the Sun tutorial on using layout managers.
    And I tried using a JLabel and then make a new ImageIcon(the target of the picture) but I have an error when I add it to the pane with pane.add(picture); where the picture is the JFrame of the photo and pane is the name of the container.because you're doing this all wrong. You shouldn't add a JFrame to a container. Have you looked at the JLabel tutorial in the Sun tutorials as was suggested above?
    Can you write me the exact commands that I should use?No, but we all can guide you to do what you want to do, but first we need to know exactly what this is. So, what exactly are you trying to do here? Details are very important.
    Thank you very much.You're welcome.
    edit: the tutorials can be found here:
    [Really Big Index|http://java.sun.com/docs/books/tutorial/reallybigindex.html]
    [How To Use Labels|http://java.sun.com/docs/books/tutorial/uiswing/components/label.html]
    [Laying Out Components Within A Container|http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html]
    Edited by: Encephalopathic on Jul 11, 2009 11:47 AM

  • How to insert a picture into the Rich Text Editor

    hi,all
    I want to make a Press Releases page,that means I have to use the the Rich Text Editor.In this item,I dont know how to quote a picture into this field.though i know there is a picture icon in this field,and when i press it,it can pup up a window.That is the Image Properties Window,under this window,there is a URL text field.But I dont know what to fill in this field,I mean,I dont know what the URL link is .can you just give me a picture URL sample ?
    is it like "#APP_IMAGES#136_1_1.jpg" or something else ?
    hope to hear from you.thanks ...
    best regards
    hlee
    Edited by: hlee on 2011-3-30 下午8:04

    Hi,
    There is three types of images reference in oracle apex.
    1 Standard image -> url reference is -----> #IMAGE_PREFIX#menu/books_64.gif
    2 Workspace images -> url reference is ------> #WORKSPACE_IMAGES#java-icon.jpg
    3 Application images -> url reference is ------> #APP_IMAGES#JqueryIcon.jpg
    hope this helps you
    Thanks,
    Jaydip Bosamiya
    +91 - 76000 23053
    [http://jbosamiya.blogpost.com|http://jbosamiya.blogpost.com]

  • How to insert a picture into excel file using ALE AUTOMATION

    Hi every body,
    I have to write report that export data from abap to exel the data contain a logo but I don't know how to insert picture to excel using ALE AUTOMATION.
    Please help me!
    Thank you!

    Hi,
    you have to join into SAP Code Exchange and download this zip:
    [ABAP2XLSX_daily.nugg.zip|http://code.sdn.sap.com/spaces/abap2xlsx/documents/btFzHQ3vKr36tCeJe7bhNc/download/btFzHQ3vKr36tCeJe7bhNc]
    Regards,
    Ivan

  • How can I insert multiple pictures into a "diary" document?

    We started traveling in an RV.  I'm keeping several journals but want to put everything into one document.  I'd like to either insert a slide show at each location I write about, or just insert a number of pictures easily!  the first time I selected about 8 pictures and they just laid over each other.  I couldn't figure out if text in front, around, and they all come in the same size, too big.  I'm looking for an easy fix as I have 22 events to write up and insert pictures in.
    Are pages the best way to go? 

    Hi billdeb411,
    Pages is certainly one way to go for creating documents such as you describe. You might want to look at this page for a better idea of its capabilities -
    Apple - Pages for Mac
    http://www.apple.com/mac/pages/
    Another possibility, particularly if you are trying to create a physical book as your end product, would be to use iPhoto. See its product page here -
    Apple - iPhoto for Mac
    http://www.apple.com/mac/iphoto/
    With it you can create a photo book with your computer and have Apple print the book out for you
    Apple - Print Products for Mac
    http://www.apple.com/mac/print-products/
    Have fun creating your diary!
    Best,
    Brett L

  • Insert a picture into the forum message body

    How can I insert quick VI examples into my posts and have them visible in the message body without someone having to open the attachment to see what I have posted.  I have seen this a lot and I always just using the attachment option only.

    Hi,
    I am wondering if there could be an easier way to embed images, without going through an edit process, and trying to get a copy of the link to the image.  It would require a change to the editor.
    Supposed another button was added for embed picture, and it would also put a copy of that image in the attachment list.  Since a message number doesn't get assigned until after the message is posted, the image link is created with a dummy tag (and not the local filename as it exists on your computer like the current embed image button.)
    Once the web server, gets the message, accepts it and assigns a message number, it would automatically swap out the dummy tag for the new server based tag.
    For example, I want to embed c:\testimage.png.  The new special button would let me select the file and also attach it as attachment #1.  It would create a link that instead of being c:\testimage.png would be http://    forums.ni.com/attachments/ni/BreakPoint/placeholder/1/testimage.png   (note: I put spaces in after http: because I didn't want this converted to a hyperlink in this message.
    Once the message is actually posted and the actual message number gets assigned, the web server would swap out "placeholder" with the actual message number.
    I think this would greatly ease posting pictures, wouldn't require editing, and reduce the risks of the edit time running out before the user has a chance to get all of the links edited.

  • Inserting several pictures into MS Word at once without using Media Browser

    In Microsoft Word 2011, we can either "insert picture from file" or "insert from photo (media) browser". For users who do not have pictures stored in iPhoto or Photobooth, we are forced to use "insert picture from file" method,
    which only allows for one picture to be added at a time. How can I add more than one picture at a time?

    It is not clear what alternative you are wanting besides those two options, but you might add a smart folder somewhere that filters by kind "image" which would let you insert image from file that is sort of like a photo browser.
    Alternatively there is a very old tip (like 2008) in
    this Mac OSX Hints thread that says you should be able to add folders to the media browser by dragging them from the finder into the media browser window. I have no idea if this still works.

Maybe you are looking for

  • How to Select the Latest file from Application Server?

    Dear All, I am working on object, which had requirement to Pick the file from application server. The Application server contain the files in ‘/temp/sms/’ directory. The files are having the name Like ‘smsqry_yyyymmddhhmmss.txt’ and I have to Pick th

  • Adobe Premier Elements 2.0 (W XP) doesn't run on windows 7

    My new computer is Windows 7.  My Adobe Premier Elelmnts 2.0 is for Windows XP.  Can I get a free upgrade/patch so it will work?

  • What is [abc-decode] in the profiler?

    My app is showing a 58% self time on [abc-decode] during the loading. What is this? My loading is really slow, but I can't figure out why. Thanks!

  • Intrv questions

    hi experts... some questions 1) HOW TO DEBUG OUTBOUND PROGRAM AND INBOUND PROGRAM IN ALE/IDOC?

  • Cs4 repeatedly crashes

    I recently purchased a mac pro. I downloaded lightroom 2, cs4 as well as a plug in by imagenomics called portraiture. Cs4 continually crashes while I'm working in it. I have updated my computer. Any suggestions?