How can I add an image to a project and change it at runtime?

I'm using JBuilder6 and I thought I saw a control to add images but I can't find it. I also wanted to be able to change the control at runtime. Also how should I specify the path so it knows how to use it? I hate to hard code one in. Since this is probably gonna be ported to other OS does Java have a way around this? I was going to put the images into my project's directory. For me to be able to just include the file w/the extension do I need to put it in the src folder or will the main directory be accessible?

To add an image, or other source file with JBuilder, you have a button call "Add to project", his icon is a folder with a green cross.
To call the Image os independant, I sugest you to put your images in a folder "image" in your project folder. Then to call them, you could use this :
image=new ImageIcon(AClass.class.getResource("image"+java.io.File.separator+imageName));Where AClass is a class of your project, in general, the class where you call getRessource;
"image" is the name of the under folder where are the image in your project folder;
imageName is a string with the name of the file witch contains the image, for exemple : "my image.gif"I hope I help you.
JHelp.

Similar Messages

  • How can I add an image to a dowload, specialy if I bougth from I tunes?

    Hello
    How can I add an image to a dowload, specialy if I bougth from I tunes?

    That is not quite right. The image must be in a directory that is under the web server's view. JSP has nothing to do with images, the browser loads images separately after parsing the HTML results to find out what images it has to load. The images must be in a place that is servable by the web server being used.
    If you were just using Tomcat as a web server, then you would have a web application directory "myapp". The images need to go under "myapp" or in any subdirectory, except the WEB-INF directory, which is a special case.

  • How can you add an image in Mail without being an attachment?

    How can you add an image in Mail without being an attachment?
    In otherwords I'd like to put my logo in the email not as an attachment but as an image.
    Is there a simpel solution to this problem?

    PBN1 wrote:
    How can you add an image in Mail without being an attachment?
    You don't.
    It's not possible. The e-mail protocol is designed for text; anything else has to go as an attachment.
    Different mail clients (such as Mail.app, the mail client bundled with Mac OS X) may have different ways of handling such attachments, but they are still attachments. Each mail client has its own rules and methods, so one may display a picture as if it were in the body of the message, but another client may do something completely different.
    A way of faking it is to format your message in HTML (which is a kind of text). The image is hosted on a remote server, not added to the message; instead, you include a link to it in the body of the message, as you would when building a web page. (This is also what the two tips helpfully provided by X423424X do, except that the link to the image is added in the signature, rather than the body of the message.) What exactly happens to it is, again, at the discretion of the mail client. In my case, for instance, displaying images in HTML messages is turned off, and will stay resolutely off.

  • How can I add a person to an event (and send that person an invite) without resending the meeting invitation to all participants?

    How can I add a person to an event (and send that person an invite) without resending the meeting invitation to all participants?

    Apple doesn't make it easy to do what you want.  However, here's how I do it. 
    Select the photo you want to move and create a new Event for it via the Event ➙ Create Event menu option.
    In the Event mode select the new Event with the one picture and drag it onto the Event you want to move the photo to.

  • I have a 2008 macbook and i lost the start up disk and forgot the password. how can i put it back to factory mode and change the password

    i have a 2008 macbook and i lost the start up disk and forgot the password. how can i put it back to factory mode and change the password

    Check out this article http://gigaom.com/apple/reset-os-x-password-without-an-os-x-cd/

  • HT201292 How can I remove billing details in my iPhone and change it to none

    how can I remove payment details to my iPhone and change it to none?

    On your phone tap on your id in Settings > iTunes & App Store and then tap on 'View Apple ID' on the popup and log into your account  - that should  give you a payments link on your account's page.
    Changing payment info : Change or remove your payment information from your iTunes Store account (Apple ID) - Apple Support
    If you don't get the 'none' option on the payment details screen : Why can’t I select None when I edit my Apple ID payment information? - Apple Support

  • How can I stop Mac Mail from underlining hyperlinks and changing them to blue?

    How can I stop Mac Mail from underlining hyperlinks and changing them to blue?

    It doesn't look like you can. But that's how you tell they are a hyperlink. Is this a problem?

  • How can I add file attachment to my form and get the attachment by email?

    I'm using this code and it works fine, but I don't get the attachment file in the email. How can I add this to my code?
    HTML
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
    <script src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js" type="text/javascript"></script>
    <script type="text/javascript">// <![CDATA[
                  $(document).ready(function() {
                    $("#form1").validate({
                      rules: {
                        first: "required",// simple rule, converted to {required:true}
                        email: {// compound rule
                        required: true,
                        email: true
                      last: {
                        last: true
                      comment: {
                        required: true
                      messages: {
                        comment: "Please enter a comment."
    // ]]></script>
    <script type="text/javascript">// <![CDATA[
    function validate ()
              if (document.form1.first.value == "")
              alert("Please enter your First Name");
              document.form1.first.focus();
              document.form1.first.style.border="1px solid red";
              return false;
              else if (document.form1.last.value == "")
              alert("Please enter your Last Name");
              document.form1.last.focus();
              document.form1.last.style.border="1px solid red";
              return false;
              else if (document.form1.emailaddress.value == "")
              alert("Please enter your Email Address");
              document.form1.emailaddress.focus();
              document.form1.emailaddress.style.border="1px solid red";
              return false;
    function has_focus() {
        if(document.form1.first.value == "")
                                  document.form1.first.focus();
                                  document.form1.style.first.border="1px solid green";
    function set_focus(x)
              document.getElementById(x).style.border="1px solid #80CA75";
    function clear_focus(x)
              document.getElementById(x).style.border="1px solid #DBDFE6";
    // ]]></script>
    </head>
    <body>
    <p><span style="color: #666666; text-align: center; font-size: 13px;">Please complete this form if you have any technical issue.</span></p>
    <form id="form1" action="http://www.southsun.com/php/tech_issue.php" enctype="multipart/form-data" method="post">
    <table style="width: 850px; font-size: 15px; padding-left: 20px; text-align: center;" border="0">
    <tbody>
    <tr>
    <td style="text-align: left; padding-bottom: 20px;" colspan="2">
    <h2><span style="color: #666666;">Please complete this form if you have any technical issue.</span></h2>
    </td>
    </tr>
    <tr style="padding-top: 40px;">
    <td style="text-align: left;"><span style="color: #abaf6f;"><strong>First Name</strong>:*</span><input id="first1" name="first" type="text" />  <br /><br /> <span style="color: #abaf6f;"><strong>Last Name</strong>:*</span><input id="last1" name="last" type="text" /><br /><br /> <span style="color: #abaf6f; padding-right: 33px;"><strong>Email</strong>:</span><span style="color: #abaf6f;">*</span><input id="email1" name="email" type="text" /><br /><br /> <span style="color: #abaf6f;"><strong>Shipping Method:</strong><br /></span> <input name="shippingmethod" type="radio" value="prioritymail" /> Priority Mail                                                                 <input name="shippingmethod" type="radio" value="store" /> In Store Pick up <br /> <input name="shippingmethod" type="radio" value="ground" />  Ground                                                                       <input name="shippingmethod" type="radio" value="3day" /> 3 Day Select<br /><br /> <span style="color: #abaf6f;"><strong>Payment Method:</strong><br /></span> <input name="paymentmethod" type="radio" value="paypal" /> Paypal Method                                                       <input name="paymentmethod" type="radio" value="creditcard" /> Credit Card<br /> <strong><br /> <span style="color: #abaf6f;">If getting an error message, please explain the error:</span></strong><span style="color: #abaf6f;"> <br /></span> <textarea id="errormessage" cols="20" rows="2" name="errormessage"></textarea><br /><br /></td>
    <td style="border-left: 1px solid grey; padding-left: 40px; text-align: left;"><span style="color: #abaf6f;"><strong>If using Paypal, Were you redirected successfully?</strong><br /></span> <input name="paypalredirect" type="radio" value="yes" /> Yes                                                                 <input name="paypalredirect" type="radio" value="no" /> No<br /><br /> <span style="color: #abaf6f;"><strong>If using Credit Card, Did you get an error?</strong><br /></span> <input name="carderror" type="radio" value="yes" /> Yes                                                                  <input name="carderror" type="radio" value="no" /> No<br /><br /> <span style="color: #abaf6f;"><strong>What happened after clicking place order? </strong><br /></span> <textarea id="placeorder1" cols="20" rows="2" name="placeorder"></textarea><br /><br /> <span style="color: #abaf6f;"><strong>Comments</strong>: <br /></span> <textarea id="comments1" cols="20" rows="2" name="strcomments"></textarea><br /><br /> <span style="color: #abaf6f;"><strong>Attach PrintScreen</strong>: <br /></span> <input name="strresume" type="file" />
    <div style="height: 50px;"> </div>
    </td>
    </tr>
    <tr>
    <td style="padding-top: 20px;" colspan="2">( * ) indicates required fields</td>
    </tr>
    <tr>
    <td style="text-align: center; padding-top: 20px;" colspan="2"><input class="button" name="submit" type="submit" value="Submit" />                        <input class="button" name="reset" type="reset" value="Reset" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body></html>
    PHP
    <?php
    echo $savestring;
    //--------------------------paramaters--------------------------
    // Subject of email sent to you.
    $subject = 'prueba con uploads';
    // Your email address. This is where the form information will be sent.
    $emailadd = '[email protected]';
    // Where to redirect after form is processed.
    $url = 'http://www.pch-graphicdesign.com';
    // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
    $req = '0';
    $target_path = "http://www.pch-graphicdesign.com/php/uploads/";
    $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
    $text = "Results from form:\n\n";
    $space = ' ';
    $line = '
    foreach ($_POST as $key => $value)
    if ($req == '1')
    if ($value == '')
    {echo "$key is empty";die;}
    $j = strlen($key);
    if ($j >= 20)
    {echo "Name of form element $key cannot be longer than 20 characters";die;}
    $j = 20 - $j;
    for ($i = 1; $i <= $j; $i++)
    {$space .= ' ';}
    $value = str_replace('\n', "$line", $value);
    $conc = "{$key}:$space{$value}$line";
    $text .= $conc;
    $space = ' ';
    mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
    echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
    ?>

    Sending a file as an attachment to an email involves setting the correct MIME type and headers. There's a brief tutorial here: http://webcheatsheet.com/php/send_email_text_html_attachment.php.
    Also, you need to use the same name as in your form. In the script you have shown here, the name of the file field is strresume, but your processing script uses this: $_FILES['uploadedfile']['name']. It should be this: $_FILES['strresume']['name']

  • How can I add an information (including pic, text and button) area in the menu?

    The picture below is captured from on video in Adobe Muse official website. How can I add an area just like the picture shows? I mean the three sleeping bags, texts below and the learn more button.
    Thank you.
    (from http://tv.adobe.com/watch/creative-cloud-for-design/adobe-muse-november-2013-hide-menu-nav igation-on-rollout/)

    This tutorial <http://helpx.adobe.com/muse/tutorials/widgets.html> has a section titled "Hiding Composition widgets on rollout to create submenus" which covers how to use a Composition widget for this purpose.

  • How can i add a new viewer to 9iAS and push client to run it ?

    Dear All,
    I hosted a page on Oracle9iAS which has links to documents of different types of desktop applications, for example: MS word, Excel, AutoCad ......
    And i've a mutiformat viewer which i need to install it on Oracle9iAS to be run when a client tries to access any of the listed documents. So, how can i install this viewer to Oracle 9iAS and push client to run it ?

    Si vous avez utilisé la commande Save As Template depuis Pages, il y a forcément un dossier
    iWork > Pages
    contenant Templates > My Templates
    comme il y a un dossier
    iWork > Numbers
    contenant Templates > My Templates
    Depuis le Finder, tapez cmd + f
    puis configurez la recherche comme sur cette recopie d'écran.
    puis lancez la recherche.
    Ainsi, vous allez trouver vos modèles personnalisés dans leur dossier.
    Chez moi, il y en a une kyrielle en dehors des dossiers standards parce que je renomme wxcvb.template quasiment tous mes documents Pages et wxcvb.nmbtemplate à peu près tous mes documents Numbers.
    Ainsi, quand je travaille sur un document, je ne suis pas ralenti par Autosave.
    Désolé mais je ne répondrai plus avant demain.
    Pour moi il est temps de dormir.
    Yvan KOENIG (VALLAURIS, France)  mercredi 23 janvier 2011 22:39:28
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How can I add an Image to a text

    Hello
    I want to add a image into the block of text as in the
    following link:
    (you can see a image in yellow color=50 years is aligned with
    the text)
    http://www.gammonconstruction.com/hk/eng/home/default.html
    How can I do this in DW-2004? do i have to use CSS here?

    Yes use css
    .imgright {float: right; padding: 10px;}
    or to the other side
    .imgleft {float: left; padding: 10px;}
    changing the padding to suit.
    and then apply the class to your image. eg here:
    http://www.dreamweaverresources.com/tutorials/images_text.htm
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au
    ~ Forum Posting Guidelines ~
    http://www.adobe.com/support/forums/guidelines.html
    "ldfinhk" <[email protected]> wrote in
    message
    news:evt8t6$jed$[email protected]..
    > Hello
    >
    > I want to add a image into the block of text as in the
    following link:
    >
    > (you can see a image in yellow color=50 years is aligned
    with the text)
    >
    >
    http://www.gammonconstruction.com/hk/eng/home/default.html
    >
    > How can I do this in DW-2004? do i have to use CSS here?
    >
    >

  • How can i add an image to a caption in a slideshow?

    So i have a slideshow with 3 images and 3 captions. i want to add a different image in each caption. how can i do this? thanks.

    Helo,
    In order to do this, first place the image anywhere on the page, size it according to the requirement.
    Then select the image nad cut it (Edit>Cut). Now double click on the Caption container and once you see a blinking cursor in it (to enter a text) paste the image there.
    You get to other images/Captions by clicking in next button and repeat the process to add images in other captions.
    Hope this helps.
    Regards,
    Sachin

  • How can I add an image to simply work on it ?

    How do I add images to my photoshop library? said to just drag and drop. I tried that but no luck.

    Yes that was my first time using it.   I couldn't put an entire image in the library because the Library is only 1 panel for the whole Photoshop session it seems.  You can open many images but there is only 1 library that holds elements for all images coming and going, the best I can tell.
    It sorta acts like Bridge's Collections panel.  It's just a holder for elements.
    I really need to learn that tool.   Too late tonight...
    Just looked into Libraries,  It is saved forever until you delete the Libraries.  It is in fact an Asset Holder.

  • How can I add new images to a saved book in Lightroom 4? Help please!

    As the title suggests, I have created a saved book in LR4. I saved it not because I had finished but because I wanted to protect my work to date. Now I cannot add new images, although I can work with (move and remove) the exisintg images in the book.
    I'm new to LR and can't help but feel that I'm missing something obvious. Any advice would be greatly appreciated!
    Thanks
    Graham

    Graham, switch to Grid view and drag the new photos to the book collection, which you'll find in the Collections panel.  Then flip back to the Book module and you'll find the photos sat there in the Filmstrip waiting to be added to the book design.

  • How can I add an image to my pop up text box built in Fireworks?

    Hello all,
    I have already built my page (a map) with all the pop up text boxes in Fireworks and imported them into my Dreamweaver page, but I would like to add an image in that same pop up box as well as the text. I tried going back to Fireworks and editing the pop up box, but there is no option for adding an image alongside the text. Is there a way I can go into the code and add the image? This is a line of code for one of the pop up boxes:
    <td rowspan="4"><a href="javascript:;" onmouseout="MM_swapImgRestore();MM_menuStartTimeout(0)" onmouseover="MM_menuShowMenu('MMMenuContainer1016121037_0', 'MMMenu1016121037_0',25,23,'Plaza_map_r11_c6');MM_swapImage('Plaza_map_r11_c6','','Plaza_ map_r11_c6_f2.jpg',1);"><img name="Plaza_map_r11_c6" src="Plaza_map_r11_c6.jpg" width="30" height="28" border="0" id="Plaza_map_r11_c6" alt="" /></a></td>
    I'm trying to avoid rebuilding the whole thing in another program! Thanks very much in advance.
    Pam

    If you have more than one of these, then I would add a class rule to your css style sheet
    .fltleft     {
         float:left;
    }.fltright     {
         float:right;
    Then add this rule to your image.
    <img name="Plaza_map_r11_c6" src="Plaza_map_r11_c6.jpg" class="fltleft" width="30" height="28" border="0" id="Plaza_map_r11_c6" alt="" (add new image here) ?>
    This will position your image to the left in the container. You can then add the fltright in the same way.
    GAry

Maybe you are looking for

  • Supplier Statement Report

    Oracle Payables EBS R12.1.2 is someone using the "Supplier Statement" (APTPSTMT) report in AP? We tried using it but it does not considers the Tax Deduction and shows the deducted amount as still an Outstanding. If someone kindly suggest any other al

  • No battery percentage at top of screen.

    Why dosen't my iPad 2 no longer show battery percentage at top of screen.

  • I want to use SKYPE... what mike do I need & what Prefs are needed?

    My G4 has a mike input plug ... But the mike I was using on my old Graphite sys will not fit. Can anyone recommend a mike to use for SKYPE on my machine and please explain what Sys prefs are needed? Thanks in advance. Jim B

  • Need JSP-URL in controlling servlet

    Hi, I have a simple questions which is driving me crazy. 2 JSP's are using same Servlet which has to process their input. Inside this servlet I need to know which jsp is calling the servlet. I tried following code :           System.out.println("req.

  • How come i cant share my project to youtube?

    after the publishing bar fills up in the iMovie dialog box, and the box disappears, i do not get the dialog box with the url to view it on YouTube and it's not showing up on YouTube.  Any suggestions?  I'm downloading from a FlipCam.  Thanks.