Image inside jLabel

Hi,
iam using a jlabel with the image inside it using the code
ImageIcon image = new ImageIcon(new URL(url));
imgLabel = new JLabel();
imgLabel.setIcon(image);
it is working fine but i cannot apply dimension for jLabel
jLabel.setSize(); is not working it is taking the image size as the label size ..
how to create the label with needed size with the image inside it..

Thank u for the reply....here is my requirment
i need to create a list of images inside a tabbedpane......that images are of different dimensions but i need to make them viwed as thumbnails.
for that i used a panel inside the tabbedpane and created label inside it ,
for that label i had set icon(which is the image i need view)..but the problem is the label with images are not coming in same dimension since the original source images are of differend dimension.......is there any solution for my problem

Similar Messages

  • How do i get a placed image to appear as image inside a layer?

    There is a long winded reason why I want this, but in essence I am trying to replicate another artwork that has been supplied to me.
    When I place a Photoshop image (TIFF / PSD etc) how can I get it so that it simply appears as <image> inside the relevant layer (screen shot attached)
    I am finding that when I place an image I do not get this

    That's what I had assumed. It just doesn't seem to be working for me. You don't think there is a Preference setting that might disable it?

  • Images inside pop-ups not displaying correctly

    I am generating a CHM using RoboHelp 10. I have certain pop-ups in some topics. These pop-ups contain screen shots. After generating the CHM, when I click the pop-ups to view the screen shots, they are not displayed correctly. That is, half of the image does not appear and there are no horizontal scroll bars either to scroll. This happens for pop-ups that are appear on the left side of a topic.The images inside pop-ups that appear to the right side of a topic appear fine when clicked.

    Hi Rick,
    Thank you for the response. Alas, updating the DHTML effects doesn't help. In the project that am working, I have used hyperlinks that are marked to be displayed as auto-sizing pop-ups.
    I also tried editing the eHlpDhtm.js file as mentioned in the thread here, https://forums.adobe.com/thread/1297423#expires_in=86399993&token_type=bearer&access_token =eyJhbGciOiJSUzI1NiIsIng1dSI6I…. But that was of no avail either.
    Do you have any other insights here?
    Regards,
    Anamika
    P.S. Am using RH 10.0.1.292.

  • Images inside pop-ups in CHM not displaying correctly

    I am generating a CHM using RoboHelp 10 on a Windows XP machine.
    I have a few pop-ups in some topics. These pop-ups contain screen shots. After generating the CHM, when I click the pop-ups to view the screen shots, they are not displayed correctly. That is, half of the image does not appear and there are no horizontal scroll bars either to scroll. This happens for pop-ups that appear on the left side of a topic. The images inside pop-ups that appear to the right side of a topic appear fine when clicked.
    The help file was originally created using RH 7. I upgraded the source files to RH 10 successfully and there were no errors during the upgradation.
    I even tried generating the CHM on other systems with RH10 and the same system configuration as mine but ended up with the same results. I assume there is some compatibility issue maybe between RH 7 and RH10.
    Looking forward to any helpful insights here as this is pretty urgent at the moment for me to resolve the aforementioned issue at the earliest.

    Hi Rick,
    Thank you for the response. Alas, updating the DHTML effects doesn't help. In the project that am working, I have used hyperlinks that are marked to be displayed as auto-sizing pop-ups.
    I also tried editing the eHlpDhtm.js file as mentioned in the thread here, https://forums.adobe.com/thread/1297423#expires_in=86399993&token_type=bearer&access_token =eyJhbGciOiJSUzI1NiIsIng1dSI6I…. But that was of no avail either.
    Do you have any other insights here?
    Regards,
    Anamika
    P.S. Am using RH 10.0.1.292.

  • Image inside facet not rendering

    <t:column>
          <f:facet name="header">                               
                  <h:graphicImage value="images/pic.gif" />   // NOT RENDERING
          </f:facet>                                                            
          <h:graphicImage value="images/pic.gif" />             // IS RENDERING
    </t:column>
    // WHY IS THE IMAGE INSIDE THE  "<facet>"  TAG NOT RENDERING ?

    Uh, yup, that sure solved it.  Thanks Tom.

  • Changing images in JLabels

    I am creating a program which needs to display a grid of 7 by 7 images, as i am new to swing and fairly new to java i decided to use JLabels to show these images.
    I also need to be able to change these images, when buttons are clicked, i have set up the listeners for the buttons and the initial grid is correct however i cannot get the images to change?
    The JLabels are done as an array so each JLabel can be identified seperately.
    I have tried changing the labels eg Images=new JLabel("newimage.gif");
    and also I have tried creating other JLabels and doing things like
    Images[i]=newLabel //newLabel has the icon i want to use.
    I have repainting the screen and if i use the setText method on the JLabels then the text is displayed, however new images aren't
    do i need to not use JLabels, if so what can i use to do this?

    i tried using the setIcon function on my screen capture program and was unable to get it to update the image as long as the old image file was the same filename as the new image file. however if you change the image file name i got it to work fine......you just can't refresh an image of the same name if you've changed the content......

  • Pen tool: Resize image inside a layer/ stop pen outline / white space after crop

    I have 3 noob questions all related to the pen tool.
    1. Whenever I use the pen to outline something and drag the image to another psd file I see a grey pen outline around the image.
    ex. http://screencast.com/t/GmKWAr5UH
    2. Whenever I outline with the pen and then select inverse and then delete the background, the background becomes white. I want to drag my outline into my new file but without a white background. it should be transparent so it appears like a collage.
    ex. http://screencast.com/t/Rh4Uvq4xBM
    3. how do I select an image inside a layer to resize it. Nothing I do creates handles around the image isnide the layer.

    Theres some basic stuff you are not understanding…
    1. In Photoshop there is the pen tool for creating abstract vector edges, and selection tools (lasso, magic wand etc). You need to turn the results of the pen tool into a selection. Best way is using the the Command/return shortcut, or command clicking on the path in the paths panel.
    2 layers need to be , not - If you want to delete areas (make them transparent). To do this either go to Layer/New/Layer from background - or hold Option and double click the Background layer.
    3 See answer 2, and use Free Transform (command T)

  • Calling a Breadcrumb image inside a Table view column

    Hi
    I want a sample code to call any bread crumb related image inside a table view column.
    Please help with a code snippet.

    I mean that, inside the iterator class of the tableView, write this code in the RENDER_CELL_START method.
    method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
      CASE p_column_key.
        WHEN 'ICON'.
    p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(       id        = p_cell_id                              src      = '@3J@'  ).
        ENDCASE.
    Inside the method, GET_COLUMN_DEFINITIONS you need to append a column for icon, see the code below:
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
        <def>-COLUMNNAME = 'ICON'.
        <def>-TITLE      = 'Display Icon'.
    For more info you can refer to weblog on HTMLB TableView Iterator by Brian.
    Hope I am clear.
    Regards,
    Ravikiran.C

  • Image inside of PDF file?

    I am creating a .bmp file in Photoshop and inserting it into a word document. I then save that image as a .pdf. When viewing pdf and hovering your cursor over the image inside the .pdf, the name of the image file appears(like a text tool tip). Is there a way to prevent this from happening?
    Thanks

    PDF Optimizer - Perhaps not available in Standard.
    Look for it under the 'Advanced' menu drop-down.
    When Acrobat supported file formats are brought into PDF with Acrobat (PDFMaker) many have configuration options associated with their "Convert to PDF".
    A supported graphics file format, by itself or if in an authoring file (FM, DOC, etc.) will be 'touched' by these.
    Open Acrobat's Preferences. Select the Category "Convert To PDF".  Scroll down the center pane's listing of  file formats. Locate and select PNG. Click the 'Edit' button. Some configuration options for compression and color management are provided. You could play with these.
    HOWEVER -
    The Word to PDF process would have to be via PDFMaker (Convert... from the Acrobat Bar) and *not* via Save As PDF-XPS.  The MS Office routine does not provide the functionality described above for Acrobat. The Office process is completely separate from anything "Adobe" or "Acrobat".
    Also, something described often by Bill@VT -- Word, particular 2007, 2010 seems to do some 'odd' things to graphics in a Word file that is going to anything other than a piece of paper.
    Some folks seem to get satisfactory behavior by use of EPS.
    Also, it may be worth playing with a JPEG of the logo.
    About the PDF.
    From what you describe it seems that you have a web link, in the PDF, to the stand alone PNG. This would permit separate download of the PNG.
    I suspect that Acrobat Standard 9.x does not provide the tool set available in Pro or Pro Extended. So, you'd not be able to edit/delete the web link (or link) in the PDF.
    Perhaps, back in Word you have a 'Hyperlink' present that can be edited/removed?
    Also, in Word, try an "import" - browse to file - select - make it an integral part of the Word file. Then produce the PDF.
    Fundamentally, the PDF reflects the content mastered in the Word file. The Office Save As PDF-XPS or the Adobe PDFMaker merely process this out with whatever configuration option settings each provides.
    Be well...

  • Image inside e-mail ??

    Hi,
    This is the code i found in e-mail, which is used to display an image inside the mail.
    <IMG src="cid:024b01c1d494$76fe2520$[email protected]">
    How can i create this image in memory and insert this image in HTML page.
    Thank you !

    OK.. I think I understand the issue. Let me just restate in my words to make sure:
    You want to be able to render the contents of an HTML formatted MIME message where the message contains an "embedded" image.
    Assuming this is your objective, I have a solution.
    If you are using a web browser to render the email, the one and only way a browser can render an image is with a valid URL path. As you correctly point out, the src of the image is not a valid url path. Thus, the only solution is to change the HTML.
    This approach can be confirmed if you simply send an email with an embedded image to Hotmail or Gmail. Using Outlook, you can "insert" an image which results in the embedded image situation in your example. If this is sent to a Gmail account (for example) and you view the source of the message at Gmail you will notice that the src attribute has been changed by Gmail.
    So... You need to parse the html and replace the src attribute of any image where the src is currently referencing another "part" of the message.
    Now... The actual image is most likely NOT in memory. This is deliberate because it may be a 10GB image which would kill your server. So, what do you replace the src attribute with?
    In the solution I implemented, I created a servlet (actually a struts action) which was supplied with the content ID (cid) if the image to be rendered. This servlet then looks into the same MIME message, finds the associated part, gets the part's input stream and pipes it straight out to the HTTP response.
    For example:
    Where you had <img src="cid:1234..."/> I replace with <img src="render.do?cid=12345..."/>
    The render.do is my struts action (servlet).
    This is the only way I know how to render embedded images in emails via a browser. If anyone else has any bright ideas?

  • Displaying Image using JLabel in swings

    I am not understanding how to display a image in swing using JLabel Component.
    I am writing in the following manner:
    // importing necessary packages
    in init() method
    public void init()
    Container cp= getContentPane()
    JLabel jl=new JLabel("Image",new ImageIcon("<image>.gif"),JLabel.CENTER);
    cp.add(jl);
    applet is running and only label msg is displaying but not the image.
    Please help me so that i can solve this problem.where the image is to be placed??and how it has to be included?
    Please provide me the solution.

    cp.add(new JLabel("Image",new ImageIcon(new java.net.URL (getCodeBase(),"Test.gif")),JLabel.CENTER));

  • Loading images inside applet JAR

    Hi
    This is my issue: I have an applet which contains images inside the applet JAR. I want to display these images in my applet, but apparently due to browser access restrictions, I'm not allowed.
    My first code was like this:
    //security restrictions on browsers do not allow getResource
    ImageIO.read(MyClass.class.getResource("imgs/img.png"));
    //getResourceAsStream should be allowed by browsers
    ImageIO.read(MyClass.class.getResourceAsStream("imgs/img.png"));Both lines work when I execute the applet locally (command line / programming IDE), but when I deploy it to my web server, the resource "imgs/img.png" becomes a relative URL to my web application context (like /webcontext/MyClass/imgs/img.png). It works locally because the call to getResource returns a URL object with "file:" protocol, but I need it to look for my images bundled inside the JAR, not web hosted images.
    I need to avoid making the applet look for these images as a web resource... how can I do it?
    Thanks!

    dev@java wrote:
    warnerja wrote:
    I'm not convinced the code you posted wouldn't work, but since this is an applet, you have access to the Applet class. Check out the Applet.getImage method in conjunction with Applet.getCodeBase.
    [http://java.sun.com/javase/6/docs/api/java/applet/Applet.html]
    getCodeBase returns my web context, like http://myhost.com/mycontext/ , so it is pretty much the same as above.
    Thanks for your replyThat is the way to load resources though. Hence back to my earlier statement about not being convinced it would not work, with this addition: It should work, assuming you actually do have the resources properly located with the web app, whether they be in a jar, or loose files relative to where the web app is. My guess at this point is that they are not.

  • Threshold image inside loop

    I am trying to threshold an image inside a while loop so the user can fine tune their threshold values.  The threshold values are being iterated correctly but when the image passes through its 2nd iteration the image goes black or disappears.  Any suggestions?  Thanks.
    Alex

    ladouceuraj a écrit :
    We are currently using shift registers but its not working.  The value is changed correctly but the image does not change.  In fact the image either completely disappears or it is thresholded entirely black.  I have attached a ss of the loop.
    According to the diagram, this behaviour is normal : once the image has been thresholded, the original data are replaced with the new [0, 1] values. Nothing left for another run.
    Define a second image and wire it to the "destination image" input of the threshold function.
    BTW, a shift register is completely useless when working with images, since the wire contains a reference  to the image structure, not the data itself.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Moving an image inside a frame

    Hi all,
    I have an image in place holder.
    I want to resize and move the image inside it.
    How can I do this with VBScript?
    I tried to do this:
    set myRect = myPage.Rectangles.Add
    myRect.GeometricBounds = Array(17.2,10.8,38.3,40.2)
    call myRect.Place("C:\image2.jpg")
    call myRect.Fit(idFitOptions.idContentToFrame)
    myRect.Resize idCoordinateSpaces.idInnerCoordinates, idAnchorPoint.idCenterAnchor, idResizeMethods.idMultiplyingCurrentDimensionsBy,Array(2, 2)
    myRect.RotationAngle = 2
    But it resize the frame and not the image...
    Thanks
    Yael

    Double click on the image and you will see the shape that frames it. Click outside the frame and your cursor becomes a hand to drag it around.  Click on the handles of the image and you can resize it.
    When in doubt try the usual things.
    Peter

  • How do I create a duplicate image inside the same page? Then how do I change the color of that image

    how do I create a duplicate image inside the same page? Then how do I change the color of that image from black to red?

    Hello there!
    Here is one way to create a duplicate image and colorize it. As you can see below, I have one image right now, that I want to duplicate.
    My layers panel looks like below.
    To duplicate your image, click the downward arrow on the right side of your Layer Panel.
    Select Duplicate Layer. This will duplicate the layer that the image is on.
    Select "OK" to approve the duplication.
    As you can now see in the Layers panel, the image is duplicated. The new layer is now at the top of the Layer panel.
    Now to colorize your image, go to Window > Adjustments.
    The Adjustments panel will now be opened. Select the Hue and Saturation icon as seen circled in red.
    The Hue and Saturation propertied panel will be opened. I selected "Colorize", and adjusted the hue and saturation bar to achieve the level red in my photo.
    As you can see below, the image is now red.
    Now i want to make sure only ONE of my image layers is red. I moved the Hue and Saturation layer to only be on top of the bottom layer. The image on the top layer now will not be affected by the red.
    Select the move tool, so I can now move the image layers so we can see both of them.
    With each image layer selected, you can take the move tool and move the images. I moved mine on top of eachother and you can see my red layer (bottom) and the non red layer (top).
    I hope that helps. i have also included helpful links.
    Please post back with any questions,
    Janelle

Maybe you are looking for

  • How do i add my access web app into a iframe on a "site page"?

    I just created a MS Access "custom web app", and published it on my site. Then i can open the Access form when i click on the link in the menu at my site. The problem is just that it removes my site logo and all the menu's. Well, its like fullscreen.

  • Systemd does not umount in spite of StopWhenUnneeded=true

    Before going into details I have to say that although I am a seasoned Linux user, I am a noob to both systemd and Arch. My goal is to setup a backup routine that starts automatically upon connection of the relevant USB storage which cleans up after i

  • How to fix a page in a multiple resolutiojn

    Hi I am designing a page in the portal 3.0.9.8.0 for a standard resolution of 800*600. The page is divided into 3 regions (150px,325px,325px)and I publish portlets within these regions. The page is displaying perfectly, but when i change my resolutio

  • Asynchronous web service call doesn't work

    Hi, I'm trying to convert a synchronous web service call into an asynchronous call. (Folder-level Javascript, Acrobat Professional 8.1, Windows XP). Everything works fine when I call Soap.Request as a synchronous call. It calls the web service and ge

  • How to convert Smart Form into PDF format and return the result in BAPI?

    I want to convert a Smart Form into PDF format and return the result in BAPI. can anyone tell me how it can be done with related example regards pranay