How can I put an image/s in Java Application?

Hi to all.
How can I put an image/s in Java Application?
I can put some images in Java applet but when i try to put it in Java application there was an error.

hey u can easily do it with JLabels...i found a Code Snippet for u
public class MyPanel extends JPanel
{private JLabel imageLabel; public MyPanel() {     Image image = Toolkit.getDefaultToolkit().getImage("myimage.gif"); // Could be jpg or png too     imageLabel = new JLabel(new ImageIcon(image));     this.add(imageLabel);  }}
hope it helps
Cheers,
Manja

Similar Messages

  • How can I put another image without its associated sound on an audio (without its image) ?

    IMovie 11 : how can I put one image without its associated sound on an audio (without its image) ? thanks

    Hi
    As iMovie doesn't orient after Time - but only after Video/Photo clips is this not so easy to do.
    I use black photos as Dummy clips - and put them into a new project first
    then I add the Music I want
    Then I drop the Video-clip (that I realy want) ontop of the black dummy photo - Where it's supposed to be - THEN IF advanced tools are selected (in iMovie preferences) there will be a Drop-Down menu and here I can select to do a Cutaway - and select not to add the audio from it (or in wave-form just silence it out)
    Yours Bengt W

  • How can I put an image onto a postcard format?

    How can I put an image onto a postcard format?

    By postcard format do you mean crop the picture into a postcard shape?
    If so, here is one way: Activate the Rectangular Marque tool. Set Style to Fixed Aspect Ratio, and enter the dimensions for Width & Height. In this example I used a standard postcard size of 6" x 4.25".  Open your picture, draw out the rectangle, and Image > Crop. The picture will now be in the 6 x 4.25 proportion.
    To get it to the actual 6" x 4.25" size, do Image > Resize > Image Size. Check the Constrain Proportions Box, and enter either the true Width or Height; the other dimension will change accordingly.
    If this is not what you are trying to do, please be more specific.

  • How can I put an image of a painting centered on to a blank 4x6 postcard?

    How can I put an image of a painting centered on to a blank 4x6 postcard?

    moopartist wrote:
    How can I put an image of a painting centered on to a blank 4x6 postcard?
    Go to File>new>blank file. Enter the dimensions, background color to suit. For resolution, it's best to have the same value as that of the image. For printing, it is desirable to have the resolution in the 240-300px/in range, although I have printed below this range.
    Open the file with the painting. Use one of the selection tools, e.g. selection brush, lasso tool, and select the image.
    Go to Edit>copy
    Open the blank file
    Go to Edit>paste. The selection will come in on its own layer
    Use the move tool to position, and, to resize (if necessary) with the corner handles of the bounding box.

  • TabbedPanels Tab - How can we put individual images on each tab button?

    Hi,
    How can we put individual propeties (like size, background images etc) in each tab button of TabbedPanels Tab?
    Thanks

    Wow ! Itz amazing !! .... This is what 'm exactly looking for
    Thanks a lot Gramps
    Alin

  • How can I put the image fixed on the bottom-left of the HTML page

    I can't put the image at the left-bottom of my div id="content". I have "textcontent" (float:left) and "sidebar" (float:right) inside the content. I am attaching my code here for your review. Please help!
    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>Interior and Exterior</title>
    <link href="main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    </script>
    </head>
    <body onload="MM_preloadImages('images/rollover_home.jpg','images/menu_home_over.png','images/m enu_paint_over.png','images/menu_contractor_over.png')">
    <div id="container">
      <div id="header">
      <div id="contactinfo">contact us for free estimates  250-878-1786</div>
    <div id="logo"><a href="index.html"><img src="images/logo.png" width="276" height="53" /></a></div>
    <div id="topmenu">
    <ul>
    <li><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','images/menu_home_over.png',1)"><img src="images/menu_home.png" name="home" width="119" height="54" border="0" id="home" /></a></li>
    <li><img src="images/menu_interior_over.png" width="177" height="54" /></li>
    <li><a href="paint_design.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('paint','','images/menu_paint_over.png',1)"><img src="images/menu_paint.png" name="paint" width="172" height="54" border="0" id="paint" /></a></li>
    <li><a href="contractor_trades.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contractor','','images/menu_contractor_over.png',1)"><img src="images/menu_contractor.png" name="contractor" width="166" height="54" border="0" id="contractor" /></a></li>
    </ul>
    </div>
      </div>
    <div id="content"><h1><img src="images/page_name_interior.png" width="286" height="27" /></h1>
    <div id="textcontent">
    <h2>Interior Services:</h2>
    <p> </p>
    <h3>Painting and staining:</h3>
    <table width="300" border="0">
      <tr>
        <td width="100">doors</td>
        <td width="100">walls</td>
        <td width="100">ceilings</td>
      </tr>
      <tr>
        <td>baseboards</td>
        <td>trim</td>
        <td>cabinets</td>
      </tr>
      <tr>
        <td>banisters</td>
        <td>rails</td>
        <td></td>
      </tr>
    </table>
    <p> </p>
    <h3>Fill and seal:</h3>
    <table width="300" border="0">
      <tr>
        <td width="100">cracks</td>
        <td width="100">baseboards</td>
        <td width="100">trim</td>
      </tr>
      <tr>
        <td>holes</td>
        <td>drywall repair</td>
        <td>cabinets</td>
      </tr>
    </table>
    <p> </p>
    <h3>Wallpaper and boarder removal</h3>
    <br />
    <p>No interior job is complete unless all the holes, nicks and gaps are filled and sealed.  I guarentee you'll be happy with the quality of our workmanship.</p>
    <p> </p>
    <h2>Exterior Services:</h2>
    <p> </p>
    <h3>Painting and staining:</h3>
    <table width="400" border="0">
      <tr>
        <td width="100">trim</td>
        <td width="100">posts</td>
        <td width="100">beams</td>
        <td width="100">hardiboard</td>
      </tr>
      <tr>
        <td>smartboard</td>
        <td>gables</td>
        <td>facia</td>
        <td>shakes</td>
      </tr>
      <tr>
        <td>shadowboard</td>
        <td>belly-board</td>
        <td>stucco</td>
      </tr>
    </table>
    <p> </p>
    <h3>Decks and rails:</h3>
    <table width="150" border="0">
      <tr>
        <td width="144">staining and painting</td>
    </tr>
    </table>
    <p> </p>
    <h3>Power washing:</h3>
    <table width="180" border="0">
      <tr>
        <td width="174">houses, fences and decks</td>
    </tr>
    </table>
    <p> </p>
    <p> </p>
    <h3>All nail holes are filled and all joints filled and sealed on all exterior painting projects.</h3>
    <p> </p>
    <h3>Stucco homes can be repainted quickly and inexpensively!</h3>
    </div>
    <div id="sidebar">
      <img src="images/interior_house.png" width="514" height="329" /><br />
      <a href="testimonial.html"><img style="padding-left: 40px; padding-top: 30px" src="images/interior_testimony.png" width="362" height="289" /></a></div>
    <p><img src="images/exterior_specialists.png" width="322" height="56" /></p>
      </div>
    <div id="footer"><img src="images/interior_footer.png" width="962" height="50" /></div>
    </div>
    </body>
    </html>

    Working with CSS Backgrounds:
    http://www.w3schools.com/css/css_background.asp
    #content {
         background-image:url('some-img.png');
         background-repeat: no-repeat;
         background-position: left bottom;
         min-height: 500px; /**same as image height**/
         overflow:hidden; /**float containment**/
    HTML
    <div id="content">
    the rest of page content goes here>>>
    </div>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • How Can I Take Print Screen With in java Application

    Hello Every One,
    Hope U all r fine.
    How can i take print screen with in java code,
    Please Help me out

    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Btitle%3A%22print+screen%22&col=javaforums

  • How can I put an image in the page header so that it will be repeated on every page?

    Hi to everyone!
    I want to create a Pages template with the logo of our company in the page header.
    I'd like to put that image (logo) in the page header so that it will be repeated on every page but it will not modify the content of the page.
    Anyone know how to achive this, or something similar without have to copy-paste that image every time we add a page to the document?
    Thanks in advance

    Takashi,
    Turn off the Page Headers (not absolutely necessary, but since you don't need it, why not)
    Put your Graphic on the page and make the following settings:
    Then Insert > Text Box and make the same settings as for the graphic.
    Place your "Header text" in the text box and arrange the box and graphic as you want them. Move both to Section Master using the Arrange menu.
    Jerry

  • How can I put the image and header in the same animation

    I am working on presentation and want to have the image (I choose "Showroom" theme) on the half side of the page (either left or right) and the text header (on the middle top) coming at the same time in the annimation. I am now doing by choose effect direction and set the oder. How can I have let say oder no 1 and 2 coming at the same time.
    Thanks,
    Monkon

    Select both objects and group them ( command alt G ) or (Arrange > Group)
    Inspector > Builds > Effects
    click more options and choose torun the build Automatically or On Click

  • How can I measure memory allocation of a Java Application?

    We built a web application that enables images to be loaded into a database through a servlet running on Tomcat. We have inconsistent behaivor when more than x number of people are loading images simultaneously. No doubt a memory allocation problem, but how can I measure it?
    For example, I'd like to be able to create a graph showing the resources used against the number of people making uploads. I am using Linux and Tomcat/Apache.
    I am hoping for something like Memory counters that are available for measurine Windows applications on MS Windows - comes with the Resource Kit. Does this type of tool exist for the Java/Linux market?

    It is difficult to gauge memory usage from a Java application as the JVM handles garbage collection and even if objects are not referenced they might still be sitting in memory until the next garbage collect.
    Anyhow, a way to query available memory is:
    Runtime.getRuntime().freeMemory()
    You can run this at the begining of a process and at the end and examine the difference. You should call System.gc() before each freeMemory() call in order to try to force garbage collection.
    Another method would be to turn to the underlying OS. On linux you could use 'top' or 'ps'. With ps you could do something like:
    ps -o rss,vsz,%mem <pid>
    Where <pid> is the parent Tomcat process' id. The resulting three columns are:
    - Amount of real memory used.
    - Amount of virtual memory used.
    - Percentage of real memory used.
    'man ps' wil give you more options on how to use ps.
    There are also fancy graphical stuff like 'gtop' as well.
    Hope this helps.

  • How Can I submit data to an external java application

    Hi Gurus,
    I've this requirement and I would appreciate if someone can provide me some guidance.
    My requirement is that we are building a webdynpro ABAP application inside our SAP system. This webdynpro application should be able to collect data from the user. When the user submits the data, this data needs to be processed by should an external java application for which we've the URL available.
    The data has to be sent to this external Java web application in the form of parameters to that application programatically through post method.
    Is there anyway we can code this in our webdynpro ABAP application.
    Please help.
    Regards,
    Sam K

    It isn't Web Dynpro ABAP functionality - per say - but you can use the class CL_HTTP_CLIENT for the ABAP server to act as a browser and make HTTP requests to other web servers.  This is how Web Services work from ABAP.  This class lets you build the request object and post it to an external server.  However you might consider if using a full blow Web Service might provide you with a better approach than just posting to an external URL.

  • How can I put a image in a label?

    thanks

    You should use a JLabel. Look at the API. BTW, you should always take a look at the API before posting a question. In this case, it's quite obvious.

  • HOW CAN I PUT A PERMANENT CAPTION ON A JPEG IMAGE?

    I have Elements 8 operating (successfully!) with Windows 7.  How can I put a caption on the Jpeg that will actually appear on the photo and will show on a print?  I would like the caption to run along the bottom of the image.  I believe that using the "Title" feature in Pre Elements will not imprint itself on the jpeg file image.  Am I right?

    Hi,
    Use the text tool.  Make a box in the approximate location you wnt the caption, choose a font and size, and type the caption into the box.  You can then use the move tool to fine-tune and adjust the location.  When satisfied, you can flatten and save the image.  Hope this helps.

  • On FCP7, how can I put down an image say at 1 minute in, and then have it stay put as I adjust what's in front of and after it?

    On FCP7, how can I put down an image say at 1 minute in, and then have it stay put as I adjust what's in front of and after it?

    Put the scene that you want to stay in one place on the timeline on a video track above the one you are editing, in the location you want it to be on the timeline, and then lock the track.
    MtD

  • How can I put my icloud photos to camera roll or photo stream?

    I got a nee iphone, i backed up everything and restored it into mu new iphone, but the pictures didn't restore so i did it manually but now on my phone i got different albums icloud photo stream and camera roll. How can i put the icloud picture into camera roll or photo stream. Any ideas?? On my old iphone ive deleted everything.

    Hello Ozzie94,
    Thanks for the additional information. The camera roll is designed for photos taken on your device, or saved images from Mail and other applications. Photos synced from a computer are organized into their own album(s):
    View photos and videos - iPhone
    http://help.apple.com/iphone/7/#/iph3d267610
    - Camera Roll—photos and videos you took on iPhone, or saved from an email, text message, webpage, or screenshot
    - Shared photos and videos—Photos and videos that you’ve shared with iCloud Photo Sharing or that others have shared with you (see iCloud Photo Sharing)
    - Photos and videos synced from your computer (see Sync with iTunes)
    Additionally, you may find more information by using another one of Apple's support resources - https://getsupport.apple.com
    Thanks,
    Matt M.

Maybe you are looking for

  • How to start OS X instead of Windows

    Hello, I installed OS Snow Leopard (latest version) and decided to install Win 7 Pro After succeeding, i used the original DVD Snow Leopard to install Boot Camp When all files where installed, i was asked to restart OK Restarted, but !... don't resta

  • Bapi to change travel expense report

    Hi,    I am working on an program to create a travel expense report using the 'BAPI_TRIP_CREATE_FROM_DATA' FM and it is working fine.However,i am unable to change the trip created using this FM.When i use the SAP transaction TRIP,i am able to change

  • Regarding two containers in alv screen

    hi, i have developed two alv reports,in which if we click on first alv report billing number we should display 2nd alv report item details in second container, but the problem is that for the first time when i click on billing number its item details

  • Segmentation violation

    I'm getting the following errors when attempting to test Net Service Name: SIGSEGV 11* segmentation violation stackbase=0x419cb000, stackpointer=0x419cabf0 Full thread dump: "CursorIdler" (TID:0x406feb00, sys_thread_t:0x41a4ee0c, state:CW) prio=5 ora

  • Outlook contacts sync puts some 1st AND last names in iPhone 1st name

    After I initially synched all my Outlook contacts onto my new iPhone, some of the names show up on the iPhone as "lastname firstname" (which is what I want), but some show up as "firstname lastname". The problem with this is that they don't sort corr