How do I place an image in an applet

I'm starting to use applets, and how do you put an image on to the viewer? This doesn't show up, can anyone tell me how?
This is my code:
Image my_gif;
URL base;
MediaTracker mt;
public void init()
mt = new MediaTracker(this);
try {
base = getDocumentBase();
catch (Exception e) {}
my_gif = getImage(base,"imageEx.gif");
mt.addImage(my_gif,1);
try {
mt.waitForAll();
catch (InterruptedException e) {}
public void paint(Graphics g)
g.drawImage(my_gif,20,20,this);

and I dunno why you're using media tracker unless you need to load many, many images. In your post it just says one - Even if you do need many images, start with one and build up:-
img1 = getImage(getDocumentBase(),"picture1.jpg"); //or
img1 = getImage(getCodeBase(),"picture1.jpg");
and make sure the images are in the same directory as the applet and test it with the applet viewer first.
Happy Chrimble Pies

Similar Messages

  • How do I place an image and insert a different photo for the "mouse down" state?

    I have placed an image within an accordian widget and when I select the "mouse down" area in the states dialog box, i click "fill" in the toolbar and insert the photo i want to display when the image is clicked but this image is "covered up" by the originally placed image and is not seen in my states dialog box.
    I have done this before when i made rectangles and placed images in rectangles. But i soon realized that you cannot add alternative text to images in rectangles for some frustrating reason.
    How do I place and image and have a different image for the mouse down state?

    Hello,
    This effect can only be achieved when you use the images as a Rectangle Fill. And as you mentioned it above, you cannot add alternative text to images because it is added as a fill and not as a image.
    I would suggest you to post this as a feature request on our "Ideas for features in Adobe Muse" section of the forums : http://forums.adobe.com/community/muse/ideas
    Regards,
    Sachin

  • How do i place an image, jpeg png or otherwise in my Signature in Mail?

    How do I place an image, jpeg, png, or otherwise in my Signatures inside of the Mail Application?

    Go to mail>prefeferences>signatures, select new with plus key signature left column,highlight that signature. Drag image into right cloumn

  • How do I place an image from PS into InDesign?

    Hi,
    I created a notecard in Photoshop and need to put two on a page in InDesign CS3. I placed the graphic on the page but it's way larger than the designated paper size. I tried going to Object>Fitting to fix the problem but nothing happened. So I tried manually setting the height and width I needed the image to be on the page and it resized the image okay but I couldn't see the entire image within the new size. So my question is how do I place an image, get it to the dimensions I need (see dimensions below) and add two to a page?
    FYI: The paper size is: 8.5 x 11 inches. The graphics are 4.25 x 5.5 inches. I need to print two to a page.
    Thanks for the help.
    ashmic

    To add to M Blackburn's advise, the two selection tools will change what you can do.
    The Selection tool (solid black arrow) will allow you to select the frame itself. It will only select the content if you click on the donut. When the frame is selected, you will see the frame with handles on the corners and centers of lines, and it will be in the color designated to the layer. The default color for layer one is blue, but this can be changed, so don't be thrown if it isn't blue for some reason. Dragging the handles will change the size and placement of the frame, and when moved toward the image, will crop it. Holding the shift key while dragging a handle will keep the frame within proportion (a 3"x5" rectangle will remain 3 units by 5 units, although those units will be larger or smaller than an inch, depending on whether you enlarge or shrink the frame).
    The Direct Selection tool (white arrow) will select the content, rather than the frame. When selecting the content, you will see the handles on a bounding box around the content, and the color will be light brown. Dragging a handle will change the size of the image, and you can also drag the whole image to move it in relation to the frame, which can be used to crop the image as well. Holding shift will keep the image size proportional.
    You should take notice of whether the frame color or the content color is what you see, because double-clicking with the Selection tool will toggle between frame and content, the way clicking within the donut will allow content to be edited while the Selection tool is active.
    If you want to view the image size as a percentage, using the Direct Selection tool is what you want. If you use the Selection tool, you will see the percentage of the frame, which will change while you are dragging it, but as soon as you release the mouse button, it will show 100%. Switching to the Direct Selection tool will show you the percentage of reduction or enlargement of the image itself, and if the X and Y aren't the same, your image is out of proportion.
    Lastly, the shift key, along with Command will probably be what you will use the most, as it will allow you to drag a corner of the frame of a placed image with the Selection tool and proportionally resize the content along with the frame.

  • How do I place an image in a div container for only 1 page?

    I am designing a web site for my wife using DW. The basic
    look of all the pages follow this format: <darhosta.com>. I
    need to make about four pages that look different that the basic
    look above. In essence I want to make the background white and have
    a 'background image in the div container. Thanks to Nancy, who
    frequents these forums, I was able to get rid of the background
    image that surrounds the main div container with the CSS she
    suggested. (Here's the page with Nancy's suggestion of the correct
    CSS and where to insert it -Thanks Nancy-: <
    http://darhosta.com/Pages/iltn.html>
    The page is almost done but I want to have a background image
    in the main div container. I've been trying to figure this out on
    my own but haven't been able to. Can anyone help me? Thanks for the
    help,
    Lou
    Note: Here the CSS that Nancy suggestion with my modification
    included to get rid of the background. If anyone needs to see more
    of the code please email me.
    Thanks again,
    <style type="text/css">
    body {
    background-image: none;
    <!--
    -->
    </style>
    I now want to place an image in the div container. I've not
    been able to figure out how to do this.

    louhosta posted in macromedia.dreamweaver
    > <
    http://darhosta.com/Pages/iltn.html>
    > The page is almost done but I want to have a background
    image in
    > the main div container. I've been trying to figure this
    out on my
    > own but haven't been able to. Can anyone help me? Thanks
    for the
    > help, Lou
    > Note: Here the CSS that Nancy suggestion with my
    modification
    > included to get rid of the background. If anyone needs
    to see
    > more of the code please email me.
    No need. All source is available from the link.
    In ilth.html, change this:
    <style type="text/css">
    body {
    background-image: none;
    <!--
    -->
    </style>
    <link href="../css/global.css" rel="stylesheet"
    type="text/css" />
    <script src="../SpryAssets/SpryMenuBar.js"
    type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarHorizontal.css"
    rel="stylesheet" type="text/css" />
    to this:
    <link href="../css/global.css" rel="stylesheet"
    type="text/css" />
    <script src="../SpryAssets/SpryMenuBar.js"
    type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarHorizontal.css"
    rel="stylesheet" type="text/css" />
    <style type="text/css">
    body {
    background-image: none;
    background-color: #fff;
    #container {
    background-image: url(../images/global/bkPage.jpg);
    </style>
    By embedding the styles AFTER the linked stylesheets, the
    rules
    will overwrite property/value pairs in identical rules that
    may already exist in the linked sheets - assuming no
    !important.
    Mark A. Boyd
    Keep-On-Learnin' :)

  • How to load/place an Image in Window UI (ID CS4)

    Hi,
    Can anybody help me on how to place an Image in User interface window.
    Thanks,
    Gopal

    var dialog = new Window("dialog", "Test");
    dialog.add ("image" , undefined, "~/Desktop/Picture.png");
    var btnGroup = dialog.add("group");
    btnGroup.orientation = "row";
    btnGroup.alignment = "center";
    var okBtn = btnGroup.add("button", undefined, "Ok");
    var cancelBtn = btnGroup.add("button", undefined, "Cancel");
    var showDialog = dialog.show();

  • How do I place an image over the header?

    I am new to web design and new to Dreamweaver CS4.  I have used 2 column template with header and footer.  I have got a header title (an image) but I want to place an image to the left of it in the top left corner of the web page.  I want the header region to be the height of the title as I want the image to have a greater height than the header area.  When I insert the image it goes into the header region and the header automatically increases its height to fit the image.  How can I overlay the image on the header rather than inserting it in the header?  Any help would be appreciated.

    Designing web pages is nothing like designing for print.   To achieve what you want , you'll either need to create a special header image in Photoshop or Fireworks that contains white space and/or slices from surrounding images.  Insert this new image into your header region.
    Or, you could simply place image in the background using CSS.  Then align your message text using CSS floats and margins.  See demo below for an example.
    http://alt-web.com/TEMPLATES/I-page-with-floats.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How do I Place an image into the center of an activated artboard in CC?

    I have just upgraded to CC from CS6. In CS6, I could activate an artboard (double click it in the Artboard panel) and then Place an image, which would by default go into the center of the artboard.
    With CC, it "loads" the image into the cursor which I then need to Place by clicking somewhere.
    How can I get it to either behave as it did in CS6, or customize to load it into the center when I click, such as with a modifier key?
    Thanks!

    Hi,
    With the Window > Allign panel,
    You can select the option to allign to selection or to Artboard.
    When you select "to Artboard" you schould be able to use the Allign option to get it centerred.
    See preview bellow.
    Hope this helps.

  • How can we place an image in already created inline graphic frame?

    Hi,
    AIM::
    To place an image in the inline graphic frame.
    OBSERVATION::
    As i have analysed the snippet Runner,i came to know that it allows to load the placegun with the file(in my case image). but in order to place it,we need to click on the document..and then the image is placed at (0,0) of the page(I suppose Indesign does it automatically).
    what is needed,is to place image in already created inline graphic frame. i have created a inline graphic frame at some position in the story,but now i required to place image in this created frame.

    I have the same problem. Can you give me a short code sample for that.
    I have an image and want to place it in the currently selected frame...

  • How can i place  a Image

    Hello Friends,
    I want to create  a image project using JSP & HTML (NWDS) and want to place the image In the portal By iview creating from par file..,plz help me any one step by step procedure or
    If u have any code plz mail to my id : [email protected]
    Thanks in advance
    Bye
    <b></b>

    This question is better answered in the portal environament.
    Regards,
    Benny

  • How can I place an image behind my header?

      I am using a template for pages and I have been selecting their different styles of pages.  They all have a image behind the header as a background...except one page.  I would like to add it, but the image will only go in front of the header.  I need to be able to see the header! :-) Anyone know how to solve this?  Thanks!

    I see the problem.
    It works on the other pages because the things behind are Background Objects, but I see no way of making the foreground objects (as on the Mailer page) background objects. Background Objects are not supposed to exist in Layout mode templates.
    I can see nothing in either the Wrap Inspector nor in the Format > Advanced options that distinguishes the two.
    As far as I can tell Apple has done something in their coding but put no User Interface on it.
    The only way around this that I can discover is to modify one of the pages where the objects are already Background Objects, to reconstruct the Mailer page by making them Media Placeholders then dragging a new image in place of the existing. Then it stays a Background Object.
    Peter

  • How can I place an image in an Report without it getting pixelated

    Hello,
    I am creating a report from my program using NIReport. In my report, I have graphs and images that are being placed in the report. My current method is using a bitmap to take a screenshot of the current view of a control, then using that bitmap to create a JPEG file and appending that file to the report. However, the graphs and images are very fuzzy and pixelated. Is there another way of adding a graph or image to the report?

    The nirconvertsample.cws example seems to have images in the table for NIReport. You can dig through that example code to see how they do it.
    Mark P.
    Applications Engineer
    National Instruments
    www.ni.com/support

  • How do you place an image on 'new background" when open documents in tabs is unchecked

    I am trying to use "mirror technique"  (watching videos to learn)
    I opened image in PS 2014....with "open documents as tabs is Unchecked..
    made a new document the size that will hold the doubled image...
    duplicated the image
    flipped horizontal...
    but when I place on "new document"...nothing happens....just separate windows..
    thanks

    On image 1, CTRL+A to select all.
    CTRL+C to copy.
    Switch to image 2, CTRL+V to paste.
    Click on Move tool and adjust layer placement as needed.
    Nancy O.

  • How do I place an image inside of a text box, then lock the image

    I have the text where I want it, in font, style, color and everything. But there is an image that I need too to go infront of the text and i need it in the text box so that both the image (which already has a clear background), matches the textbox which also too has a clear background.

    Copy and paste the image inline.
    Or simply overlay it and group the textbox and image.
    Menu > Arrange > Group
    Menu > Arrange > Lock
    Peter

  • How can I place an image hot spot on top of a ap div with an image in the background of the ap div?

    It won't let me

    Right. You can't make an image map out of a background.  You must insert the image directly into the page (HTML markup).  Then apply hotspot tools to the image.
    HTML Image Map
    http://w3schools.com/html/tryit.asp?filename=tryhtml_areamap
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

Maybe you are looking for

  • Flash player crashes in firefox but not in waterfox ??

    i have tried the downgrade to ver 10 of flash. no problem in firefox but now my other programs that use flash will not run. error messages say that i am not up to the correct version. i uploaded waterfox and have had no problems using the latest flas

  • Safari crash in text box: 100% reproducible

    Since yesterday Safari has been crashing several times an hour. More often than not, the browser crashes when I type in a text box input field. For example, as soon as I type the first letter in the title field of this post Safari will crash. This is

  • Writing text messages... BUG

    When i write a text message, the text does not scroll in the preview. In System font size 9, this works fine, but the error occurs at larger. i think it's a bug..

  • Mail Stationery the te

    I tried to use the Mail Stationery to send a mail to a relative. All those templates look great but... I typed more text than possible and the template just gives me this sound that there are no more actions to do. That is annoying if you can only ty

  • Why haven't i received my confirmation e-mail about my order? I ordered yesterday afternoon.

    I ordered by phone yesterday afternoon and I have not received a confirmation e-mail about my order. I was just wondering when I would get one. I have a confirmation number and my order is in MyVerizon. Thanks.