How to show an image(jpg/gif) on a JTabbedPanel

Hi
I tried to show an image on a JPanel of a JTabbedPanel.
I the only way to show it for some time was this:
in the StateChangedListener I use drawImage when the selected panel is teh one I want to draw the image at.
Tracing code makes the panel show, burt when I step
all the way up, the panel will be repainted without my image.
I use mediatracker to get the image loaded.
Any Idea
Hanns

JTabbedPane has components as its tabs. Using a JPanel is not mandatory. Try using a JLabel instead with an Icon (use ImageIcon) in it.
JTabbedPane tabbed = new JTabbedPane();
tabbed.addTab(
    "my image panel",
    new JLabel( new ImageIcon( "images/MyIcon.gif" ) )
);if your were referring to the image of the little tabs, use this:
JTabbedPane tabbed = new JTabbedPane();
tabbed.addTab(
    "my tab",
    new ImageIcon( "images/MyImage.gif" ),
    myPanel // instance of Component, can be a JPanel or any JComponent you want.
);

Similar Messages

  • How to show an image in apex

    Hello everone!
    Do u know how to get an image (JPG, gif, bmp) which is saved in the BLOB in a table?
    I suppose that exists an apex function which allows to do that.
    Any help would be very appreciated.
    Thank u in advance.
    Regards

    There are two examples in my demo application:
    http://apex.oracle.com/pls/otn/f?p=31517:64
    http://apex.oracle.com/pls/otn/f?p=31517:212
    which will give you an idea how that can be done.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to save and retrieve jpg/gif format image in db2

    Here am facing problem to insert jpg/gif format image in my database. And at the same time i would like to know how to retrieve that and how to display that image in my html page. So please help me in this matter.

    In future JDBC questions should be posted into the JDBC Forum

  • How desactivate the smooth for jpg,gif images¿?

    Hi
    I need view the images pixelates...no smoothing...
    because in others computers with out Geforce card, show pixelate.
    Driver 4403
    Windows XP
    How desactivate the smooth images¿?...

    Sorry...my english is terrible
    i zoom in the image but the video card smooth the image...and i cant see the real state of the image...if stay pixelate or not...always smooth....how desactivate this option in my video card

  • How to save an image to *.gif or jpg?

    Hello All,
    I'm stumbling upon another problem. I can save my displays as *.jpg file but it's very blurry, is there a better way to do this? My code as below:
    try
    OutputStream out = new FileOutputStream(new File("./outfile.jpg"));
    Image image = this.createImage(this.getWidth(),this.getHeight());
    Graphics g = image.getGraphics();
    this.paint(g);
    ImageIO.write((RenderedImage)image, "jpg", out);     
    out.flush();
    out.close();
    }catch(Exception ee) {}
    Any suggestion is greatly appreciative. Thanks in advance!

    Try looking at "Encoder" in the search - that should fix you up matey

  • Loading Images jpg, gif, png

    What is the most effective way to load an image in my application?
    Bellow is how i am currently loading the image:
    private void drawMap() {
    Graphics g = this.picturePanel.getGraphics();
    Image img = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/images/claymonmap.gif"));
    g.drawImage(img,0,0,this);
    This method works however it takes sometime for the image to show. The method is called from a button action, and the image wont display unless I have pressed the button alteast two times. I do not need to do an manipulation to the image simply display it.
    I was hopeing for a more instantaneous result.
    Your input would be greatly appreciated.

    I changed to using imageicon and i found that its is much quicker thanks.
    however i am having troubles with the method bellow. When i click a certain button the focus on a tabbed pane goes to buildingPicturePanel, and the picture flashes up for a microsecond and then the panel goes blank again. The picture wont show till i click the button again.
    void getBuildingPic(String id) {
    Graphics gBuilding = this.buildingPicturePanel.getGraphics();
    ClassLoader cldr = this.getClass().getClassLoader();
    String pathBuildPic = "images/"+ id +".jpg";
    java.net.URL imageURL = cldr.getResource(pathBuildPic);
    ImageIcon img = new ImageIcon(imageURL);
    img.paintIcon(this.buildingPicturePanel, gBuilding, 0, 0);
    could this be becuase the way i am painting the icon?

  • How to show an image in JSP given the bytes[] of the photo?

    Hi all,
    I stored a user's picture in the db as text. For this I simply converted the JPG to bytes[] and from bytes to string: Base64.encode(bytes)
    Now I wish to do the reverse - to 'output' the image on the screen. So given the bytes[] of the image with
              byte[] bytesDB = Base64.decode(userPhotoStr); //userPhotoStr is something like this: /9j/4AAQSkZJRgA...Question: How can I show the image in the JSP page embedded in the page not as download?
    I'm using struts with JSP pages.
    Thank you!!!!

    Images in HTML are to be displayed using <img> element. All what an <img> element can take as image is an URL pointing to the image in question.
    If the image is dynamic, then you can just let that URL point to some Servlet which takes some request parameter or reads the path info, reads/gets the image as byte array or (much more efficient) as inputstream and writes it to the outputstream of the response.
    You may get some ideas out of this: [http://balusc.blogspot.com/2007/04/imageservlet.html].
    By the way, massaging the byte array from/to a String is a terribly bad idea. Just store bytes as computer readable bytes, not as human readable characters, this makes completely no sense. Characters on its turn have to be converted to bytes again after all, but now you've let the DB do the work. All with all a performance pain. Bytes > Chars > Bytes > Chars > Bytes instead of just Byes > Bytes. In database you normally use BLOB, BINARY or equivalent for this in combination with JDBC's PreparedStatement#setBinaryStream() and ResultSet#getBinaryStream().

  • How to show an image stored by using SQLLDR as BLOB in ORACLE 10g

    Hi!
    i used SQLLDR to upload images from localhost to my oracle db,
    i saves theme as BLOB`s.
    my problem is:
    i can not view them correctly, showing it using the code below, i get:
    gtìSNEvR=Cm¯ö¾ÆTÿmÖØÏs_û«¬ú ÿSê¯HwýÓ ›[[ü/ñŠÝßSº‡—¢
    does any know what to do?? can help me??
    thank you!
    A.H.S.
    <?php
    echo "<p>Attempting database connection...</p></p>";
    $db_conn = ocilogon("username", "password", "ORACLE_SID");
    if (!$db_conn)
    echo "...FAILED. Check the username, passwd, dbstring given in this script are valid or not.</p>";
    if (OCIError($db_conn))
    $erra=OCIError($db_conn);
    dodberror("SQL Error: $erra $erra[message]");
            exit;
          else
            echo "<p>Connected...</p></p>";
    $table_name="images";
    $stmt = ociparse($db_conn, "select * from $table_name" );
         if (!$stmt)
            echo '<p>parsing error</p></p>';
          if (!ociexecute($stmt,OCI_DEFAULT))
            echo "<font color='red'><p>query execute error!</p></font>";
           echo "<table border=1 cellspacing='0' width='50%'>\n";
           $ncols = OCINumCols($stmt);
           echo "<tr>\n";
           for ($i = 1; $i <= $ncols; $i++) {
                $column_name  = OCIColumnName($stmt,$i);
                echo "<td><b>$column_name</b></td>\n";
           while (OCIFetch($stmt))
               echo "<tr>\n";
            for ($i = 1; $i <= $ncols; $i++)
              $column_name  = OCIColumnName($stmt,$i);
              $column_value = OCIResult($stmt,$i);
              if($column_name=="DATA")  
              //Header("content-type: image/jpg");
               $image = "$column_value->load()";
               echo $column_value;    // gives OBJECT!
               echo "<td><img src='$image' width='48' height='48' align='middle' border='0' alt='not found'> </td>\n";
              //echo "<td><img src='$column_value.jpg' width='48' height='48' a-lign='middle' border='0' alt='not found'> </td>\n"; //works 100%
              //$c1 = '<IMG height=128 width=600 SRC="http://host/' . $row[2] . '">';
                //if ($row[image]) { 
              //header("Content-Type: $row[image_type]"); 
              //print "$row[image]";
                else
              echo "<td><b>$column_value</b></td>\n";
            echo "</tr>\n";
          echo "</tr>\n";
           echo "</table>\n";
          OCIFreeStatement($stmt);
          OCILogoff($db_conn);
        ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Do you need to uncomment one of the header() functions? Make sure
    it is called before any text or whitespace is sent.
    Look at the example in PHP 5 Code to Upload and Retrieve an Image (aka BLOB) with Oracle
    -- cj

  • How to show a Image (from shell, python or what ever)

    Hi guys
    An Application written in c#/mono takes up to 7 seconds to start. So i was asked to do a little splash screen for it.
    I coul'd not figure out how to do it from shell and i couldn't find the pygtk bindings installed, so i did it quick and dirty in mono showing just an animated gif and killing the process after the applicaiton started.
    The problem with this Solution is that the splash screen itself takes up to 3 seconds to show up, which is quite long.
    Any idea how i could do it from shell or maybe in python or c? Thing is, i can't install any new libraries on that system so it has to be done with the very basic stuff that comes with the xserver.
    Window manager is fvwm. And i would like to stick with the animated gif, since i already have it.
    Lg, Archdove
    display (imagemagic) is probably installed. But how can i deactivate the window decorator? It would also help if i could just set the window title by my self since there is a rule (which i cannot alter or add one more) to do this for special windows.
    Last edited by Archdove (2012-01-25 19:05:38)

    Got it with the -title switch... don't know if it will help me tough
    I just keep updateing here... the tool animate has to be used to animate the gif.
    So what i still need to know is how i can set the exact position of the window to be shown.
    animate -geometry 100%+0+300 -delay 10 -title windowTitle loading14.gif - BÄM!
    Last edited by Archdove (2012-01-25 19:35:56)

  • How combine a jpeg image & animated gif image & save  it as GIF ?

    i have an jpeg image, & also aminated gif image, how do i place the animated gif image over (in the center of the image) a jpeg image & save it as gif file ??

    First thing you need to do is stop thinking in terms of file formats once the files are in photoshop they are all the same. The exception being vector vs raster. But in this instance the process is rteally the same so 6 on one hand a half a dozen on the other. Or as some would say Tomatoe, tomahtoe(mispelled on purpose).
    The jpeg I would assume is the background image and the gif image is the fore ground object. Open the jpeg, and then place the gif file. As long as the fore ground object has transparency, your job is pretty much done. If not, then it will be up to you to mask what you want to keep vs what you don't and apply that selection to the foregrounds layer as a mask.
    Google the net or skim the users manual for the keywords - mask, selections, quickmask, pen tool, paths. Each of these can in one way or another take care of your issue.
    It would be worth your time to also go through the numerous videos about photoshop and see how its done.
    Either go to adobe tv,
    Itunes podcasts
    or one of the following web sites:
    http://kelbytv.com/
    http://creativesuitepodcast.com/

  • How to show an image in an Enumeration description

    Recently I have tried to show an image instead of a text description, when I use a RadioButtonGroupByKey UI Element.
    What I need is to show some sort of a semaphore which can be set by a processing user. Is it possible to achieve this, or do I have to play around with the layout?
    Thanks in advance

    Wrong forum

  • How to Show custom image  on Google Map Oracle Apex 4.1 page

    Hi.. All,
    Need to show custom Image (From Database Table which is a BLOB Column) as Marker on Google Map with fixed size if we zoom in or zoom out.
    I am using Apex 4.1 and oracle11g r2.
    Thanks in Advance

    Hello,
    This plugin Does Exactly What You Need.
    http://www.apex-plugin.com/oracle-apex-plugins/item-plugin/extension-warp11-gmaps-item_109.html
    Please read the comments on the plugin, in case you come across problem in running the plugin....
    Best Regards,
    Fateh
    If you believe that my answer was correct, then please mark the answer as correct. This is for the best of all

  • How to show an image from   html ?

    Hi,
    I have an image from a html that I want to show, it�s in a html:
    <BODY LANG="pt-BR" DIR="LTR">
    <P STYLE="margin-right: 0.63cm; margin-bottom: 0cm"><IMG SRC="??????????\Trabalho_html_86e8006.gif" ALIGN=LEFT HSPACE=12><BR>it�s stored in a database and I�m using an outputtext to show it.
    I�d try to use c:\ but it did not works.
    What path do I have use to correctly display the image ???
    Thanks
    Marlos Rodrigues

    duplicate of http://swforum.sun.com/jive/thread.jspa?threadID=50363&tstart=0

  • How to show thumbnail images in finder?

    Windows can do this, so I'm sure Mac must be able to ....
    When I am viewing a list of jpegs in the finder, how can I see thumbnail versions of the images? Currently, all that's displayed is the jpeg icon.
    Thanks.

    If you have files that don't show a thumbnail icon, it may be that whatever program created the files didn't create a thumbnail image.
    You can add the preview image quite easily using a program like
    QuickImage (http://www.versiontracker.com/dyn/moreinfo/macosx/19253)

  • How to show JPEG-images with Forms?

    I am able to display .bmp-images in Forms, but according to the documentation it must be possible to display JPEG-images as well. How do I do that?
    null

    Procedure is the same as you call bmp. but you have to write 'JPEG' in place of format where you write bmp. and file_name.JPG where you write file_name.bmp.
    That may help.
    Mustafa

Maybe you are looking for

  • Cannot open "filename" because it was saved with a newer version of Adobe InDesign CC (10.0).

    I updated my whole cloud last week. Now I can't open a InDesign document saved just the day before. I get the error message: Cannot open "filename" because it was saved with a newer version of Adobe InDesign CC (10.0). Cannot open "filename" because

  • Can SCCM Manage/Wipe SD Card on the Lumia Phone ?

    Hi We are deploying Windows Lumia 735 in our company but there is not much storage left for the user to store photos , about 2 GB. We are using SCCM/Intune to manage the devices and we want to make sure that any photos , document on the SD Card can b

  • URGENT HELP! WITH CD DRAWER NOT CLOSING DURING TIGER UPGRADE

    I am installing Tiger using 4 upgrade cds and on the 3rd the drawer will not close by itself and continue on! How can I prompt the eMac to continue the install?

  • Z10 not turning on

    Hello BB world! I have a Z10. I've had it for a few years now. No real issues with it until now. Just today, I was using my phone like normal, set it down and noticed a blue screen. I pulled the battery and plugged in the phone, but now the phone won

  • SAP BO Data Services Repository Login error

    Hi All, I am a new SAP data services 4.0 user. I am getting following error while connecting to the repository while starting the designer. ERROR: ODBC call <SQLDriverConnect> for data source <SERVERNAME> failed. <[Microsoft][ODBC SQL Server Driver][