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

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

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();
    "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();
    "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.

    There are two examples in my demo application:
    which will give you an idea how that can be done.
    Denes Kubicek

  • 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¿?

    I need view the images smoothing...
    because in others computers with out Geforce card, show pixelate.
    Driver 4403
    Windows XP
    How desactivate the smooth images¿?... 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 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:
    OutputStream out = new FileOutputStream(new File("./outfile.jpg"));
    Image image = this.createImage(this.getWidth(),this.getHeight());
    Graphics g = image.getGraphics();
    ImageIO.write((RenderedImage)image, "jpg", out);     
    }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"));
    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"; 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: [].
    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

    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!
    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))
    dodberror("SQL Error: $erra $erra[message]");
            echo "<p>Connected...</p></p>";
    $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);
              //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]";
              echo "<td><b>$column_value</b></td>\n";
            echo "</tr>\n";
          echo "</tr>\n";
           echo "</table>\n";

    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:

  • 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

    This plugin Does Exactly What You Need.
    Please read the comments on the plugin, in case you come across problem in running the plugin....
    Best Regards,
    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 ?

    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 ???
    Marlos Rodrigues

    duplicate of

  • 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.

    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 (

  • 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?

    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.

Maybe you are looking for

  • Erroe while invoking a process (could not validate SAML)

    Hi, I am getting the following error while invoking a process from Weblogic  Portal Server.The invocation happens properly always but after frequent  intervals(approx 1-1.5 hrs) this error comes.Then if the Portal Server(the  client which is invoking

  • FM to change / split SD schedule lines in batch

    Dear all, Following scenario: Material A: Current available stock: 1000 pcs,             Purchase Order 10000 pcs arriving on 01.09.06             SD order with 2000 pcs. When I run the availability check for the SD order in VA01, the system would cr

  • How to add data in User Defined table

    Hello Experts, I have design form in screen painter , 3 text boxes and labels, 2 add buttons with uid 1 and 2 , and i have created tables and fields maually and registered new object i have also mentioned table name and alias in property box with fie

  • Closing of PO

    Hi guys, Would like to seek assistance in closing of POs. We have POs that are created years ago and are still open. However we have 2 problemsu2026 [1] Delivery was already made using some of this PO. We cannot tick the "Delivery Complete" [2] There

  • Capture Now does not complete capture

    I completed a project with 7 DVDs. I found one, the first one, that had an error. It has been about 5 months since I completed this first DVD. Since I needed more disk space I could not keep all of the information for the seven disks so I started del