How can I display an image in AWT Panel

notes: I can't use swing, don't tell me something relate to swing, I need to use pure AWT

Load it with [url http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Toolkit.html#createImage(java.net.URL)]Toolkit.createImage or [url http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ImageIO.html]ImageIO
Subclass Canvas
[url http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html#drawImage(java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver)]Graphics.drawImage

Similar Messages

  • How can i display a image file which is placed in the applications server

    Hi all,
    Can any one help me how can I display a image file which is present in the application server.
    With regards,
    M.Ramana Murthy

    hi,
    *& Form TOP_OF_PAGE
    * text
    FORM F_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo = Logo name
    * I_END_OF_LIST_GRID =
    ENDFORM. "TOP_OF_PAGE
    rgds
    Anver

  • How can I Display a Image with tiff format in Jpanel?

    How can I Display a CMYK Image with tiff format in Jpanel ? Not in ScrollingImagePanel? Thank you in advance.

    Why nobody can help me?I am very anxious!help me,please!

  • How can I display an image from a shared-network folder?

    Hi
    Does anyone know how I can display images from within APEX that are found outside the database? What configuration have I missed?
    Within Windows-Internet-Explore I can access the following image using the below URLs, BUT I cannot access it from within APEX?
    What do I need to do so APEX can display theses images from our internal shared network folder?
    both these URLs work within Firefox (but on APEX):
    \\Saremote\UPDOWNFILES_DIR\polk_insight.gif
    file://///Saremote/UPDOWNFILES_DIR/polk_insight.GIF
    So within APEX I have created a "display as Text' Item that works with this "amazon image" syntax:
    {lessthan} IMG SRC= {doublequot} http://g-images.amazon.com/images/G/01/associates/navbar2000/logo-no-border(1).gif {doublequot} {greaterthan}
    BUT sadly not with my image:
    {lessthan} IMG SRC= {doublequot} file://///Saremote/UPDOWNFILES_DIR/polk_insight.GIF {doublequot} {greaterthan}
    Any ideas would be appreciated.
    Thanks
    Steve
    Edited by: [email protected] on Sep 12, 2008 8:30 AM
    Edited by: [email protected] on Sep 12, 2008 8:31 AM
    Edited by: [email protected] on Sep 12, 2008 8:32 AM
    Edited by: [email protected] on Sep 12, 2008 8:33 AM

    If you have a local html file, or open an image locally from the menu, then yes, it works, but with web pages that are served from a remote location (web server), security kicks in and prevents the web page from accessing local files (and files on a networked drive).
    you will either have to put the image on the web server and access it through http, or you can load it into the database/workspace images and access it that way.

  • How can I display three images in video rate succession (60 Hz)?

    For a structured illumination microscope application, I have developed a VI that creates three images and displays them in rapid succession (as fast as the loop will go) on a second monitor.
    From the naked eye it's pretty apparent that the loop is not displaying the images at video rate.  Is there a way (perhaps with some sort of buffer) to get them to display faster?  Is WinShow simply not going to be fast enough, and if not, what's an alternative method of displaying the images?  If it helps, the images need only be displayed once each (the loop was just for testing).
    Also, what is a way to measure the frame rate output of the images?
    (sorry for the sloppy code, new to LabView)
    Thanks,
    -T
    Attachments:
    illuminationpattern.vi ‏31 KB

    Hello,
    Why don't  you try drawing one window, call IMAQ WindShow once outside of the loop, then redraw that window each iteration within the loop.  Hopefully this stops the flutter of the window.  You can build a 3 element array of the 3 IMAQ images then use an index array to alternate through which image you want to be redrawn into the single window.  The constant calling of IMAQ WindShow seems messy.
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • How can i Display my images in cover flow view in Keynote?

    I am working on a project .I am on Mavericks . I need to make a presentation of my project ideas . My project involves showing some images in cover flow view . So, is there any way i can show my images in cover flow view in keynote or pages app or by using any other app .

    Keynote is an screen based presentation application
    Pages is a page layout application for print output
    Coverflow is a viewing option of the finder to look at the contents of a folder
    To create a slideshow of your images, open Keynote and drag and drop images from a folder into the Navigator pane then press the play button
    The Navigator panel is the side panel on the left

  • How can i display an image in a canvas where full of Graphics2D component?

    i just learn to use Graphics2D components, but my boss ask edme to replace all the rectangles by some folder image in application's canvas... Gee! i got stuck there for 2 days
    could u help me please?

    the problem is i drew some Rectangles on the canvas ("g2.draw(new Rectangle2D.Double(x, y, rectWidth, rectHeight));") and now the requirment is to replace all these Rectangles to some image (the folder icon image i made with photoshop "folder.jpg")
    what am i suppose to do?? i cant find any method to make this amendment.
    reagarding to the drawImage() method could u please send me some sample code to demonstrate how to implement that? i am trying to understand all paramaters like (BufferedImageOp/ ImageObserver ) but i still cant get it.
    i am a new guy in java programming, please help me out here, thanks a lot!

  • How can i display an image as background in JFrame ?

    Please give me one demo program...!
    Thanks,
    Madan

    I can give you lots of demo programs [url http://onesearch.sun.com/search/onesearch/index.jsp?charset=utf-8&qt=background+image&rf=0&ref=http%3A%2F%2Fforum.java.sun.com%2Fthread.jspa%3FthreadID%3D668691%26tstart%3D0&rt=1&nh=10&cs=0&col=developer-forums]here

  • How do i display an image onthe front panel...without buffering ? (dsd format...)

    Hello all...
    i have got to the DS Send Image.vi and i see that i can send an image
    and receive it too..but the catch is that the data is in a "dsd"
    format. any idea how i could get to this format, or what am i doing
    wrong and is it that i dont really need this format?
    i see that there are a few Read/Write JPEG file.vi's too but they have
    proved of little use to me.
    could anybody throw some light on this please...
    thank you,
    -U

    If you are not using buffered datasocket, sending the picture is just like sending any complex data like an array. Have you tried just removing the buffering part of the example?
    The dsd (datasocket data file) is an NI datatype and there are no documents on the format for this file type.

  • How can I display images that are not included in any collection?

    How can I display images that are not included in any collection (some filter or smart collection)? A smart collection with parameters "Collection - contains - empty field" does not work. Lightroom 5.

    Thank you! Good idea! I ordered letters of the alphabet (space separated), and it works.

  • How can I display images in drop down.

    Hi All,
    How can I display images in drop down.
    <select><option>image here</option></select>
    please reply soon.
    anser please
    Thanks

    I have not found html forum..That's just incredible.
    where can i find it ?Sorry, I'm still recovering from that remark.
    please reply soonEvery time you end a post with this, or "urgent" or other such keywords, the forum automatically introduces a 5 minute delay so that will actually make the whole process slower (not faster).

  • How can i display image in RTF template when Oracle Apps running in Windows

    Can any body help how can i display image in RTF template when oracle apps running in Windows Server.
    Thanks
    Ravi

    Hi Ravi,
    You can add images into your rtf template using MS Word Insert Picture feature.
    Did you try this method?
    Thanks
    Ravi
    [email protected]

  • Help!How can i draw an image that do not need to be displayed?

    I want to draw an image and save it as an jpeg file.
    first I have to draw all the elements in an image object.I write a class inherit from Class Component,I want to use the method CreateImage,but I get null everytime.And i cannot use the method getGraphics of this object.Thus i can not draw the image.
    when i use an applet,it runs ok.I use panel and frame,and it fails.
    How can i draw an image without using applet,because my programme will be used on the server.
    Thank you.

    you could try this to create the hidden image
    try
              GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
              GraphicsDevice gs = ge.getDefaultScreenDevice();
              GraphicsConfiguration gc = gs.getDefaultConfiguration();
              offImage = gc.createCompatibleImage(100, 100);
              offG = offImage.getGraphics();
          catch(Exception e)
              System.out.println(e.getMessage());
          }

  • How can I display JTextFields correctly on a JPanel using GridBagLayout?

    I had some inputfields on a JPanel using the boxLayout. All was ok. Then I decided to change the panellayout to GridBagLayout. The JLabel fields are displayed correctly but the JTextField aren't. They are at the JPanel but have a size of 0??? So we cannot see what we type in these fields... Even when I put some text in the field before putting it on the panel.
    How can I display JTextFields correctly on a JPanel using GridBagLayout?
    here is a shortcut of my code:
    private Dimension sFieldSize10 = new Dimension(80, 20);
    // Create and instantiate Selection Fields
    private JLabel lSearchAbrText = new JLabel();
    private JTextField searchAbrText = new JTextField();
    // Set properties for SelectionFields
    lSearchAbrNumber.setText("ABR Number (0-9999999):");
    searchAbrNumber.setText("");
    searchAbrNumber.createToolTip();
    searchAbrNumber.setToolTipText("enter the AbrNumber.");
    searchAbrNumber.setPreferredSize(sFieldSize10);
    searchAbrNumber.setMaximumSize(sFieldSize10);
    public void createViewSubsetPanel() {
    pSubset = new JPanel();
    // Set layout
    pSubset.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    // Add Fields
    gbc.gridy = 0;
    gbc.gridx = GridBagConstraints.RELATIVE;
    pSubset.add(lSearchAbrNumber, gbc);
    // also tried inserting this statement
    // searchAbrNumber.setText("0000000");
    // without success
    pSubset.add(searchAbrNumber,gbc);
    pSubset.add(lSearchAbrText, gbc);
    pSubset.add(searchAbrText, gbc);
    gbc.gridy = 1;
    pSubset.add(lSearchClassCode, gbc);
    pSubset.add(searchClassCode, gbc);
    pSubset.add(butSearch, gbc);
    }

    import java.awt.*;
    import java.awt.event.*;
    import javax .swing.*;
    public class GridBagDemo {
      public static void main(String[] args) {
        JLabel
          labelOne   = new JLabel("Label One"),
          labelTwo   = new JLabel("Label Two"),
          labelThree = new JLabel("Label Three"),
          labelFour  = new JLabel("Label Four");
        JLabel[] labels = {
          labelOne, labelTwo, labelThree, labelFour
        JTextField
          tfOne   = new JTextField(),
          tfTwo   = new JTextField(),
          tfThree = new JTextField(),
          tfFour  = new JTextField();
        JTextField[] fields = {
          tfOne, tfTwo, tfThree, tfFour
        Dimension
          labelSize = new Dimension(125,20),
          fieldSize = new Dimension(150,20);
        for(int i = 0; i < labels.length; i++) {
          labels.setPreferredSize(labelSize);
    labels[i].setHorizontalAlignment(JLabel.RIGHT);
    fields[i].setPreferredSize(fieldSize);
    GridBagLayout gridbag = new GridBagLayout();
    JPanel panel = new JPanel(gridbag);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.insets = new Insets(5,5,5,5);
    panel.add(labelOne, gbc);
    panel.add(tfOne, gbc);
    gbc.gridwidth = gbc.RELATIVE;
    panel.add(labelTwo, gbc);
    gbc.gridwidth = gbc.REMAINDER;
    panel.add(tfTwo, gbc);
    gbc.gridwidth = 1;
    panel.add(labelThree, gbc);
    panel.add(tfThree, gbc);
    gbc.gridwidth = gbc.RELATIVE;
    panel.add(labelFour, gbc);
    gbc.gridwidth = gbc.REMAINDER;
    panel.add(tfFour, gbc);
    final JButton
    smallerButton = new JButton("smaller"),
    biggerButton = new JButton("wider");
    final JFrame f = new JFrame();
    ActionListener l = new ActionListener() {
    final int DELTA_X = 25;
    int oldWidth, newWidth;
    public void actionPerformed(ActionEvent e) {
    JButton button = (JButton)e.getSource();
    oldWidth = f.getSize().width;
    if(button == smallerButton)
    newWidth = oldWidth - DELTA_X;
    if(button == biggerButton)
    newWidth = oldWidth + DELTA_X;
    f.setSize(new Dimension(newWidth, f.getSize().height));
    f.validate();
    smallerButton.addActionListener(l);
    biggerButton.addActionListener(l);
    JPanel southPanel = new JPanel(gridbag);
    gbc.gridwidth = gbc.RELATIVE;
    southPanel.add(smallerButton, gbc);
    gbc.gridwidth = gbc.REMAINDER;
    southPanel.add(biggerButton, gbc);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(panel);
    f.getContentPane().add(southPanel, "South");
    f.pack();
    f.setLocation(200,200);
    f.setVisible(true);

  • How can I attach an image without the image is in the email body? (using the new mail the Lion)

    How can I attach an image without the image is in the email body? (using the new mail the Lion)
    I want in attachment, not in the body mail.

    I think your only solution is to zip the image files first and then attach them.
    Read this from a site I found:
    Sending Graphical Attachments -- When you attach a graphical image to your message, the recipient of your message sees the image inline (that is, in the body of the message) if her email client supports inline display. ("Take Control of Email with Apple Mail" contains a table listing the capabilities of popular Mac and PC email clients.) If a client does not support inline display (or the recipient has turned off the inline display option), the file appears as an attachment that must be opened in a separate program.
    On the one hand, an inline image is easier for the recipient to see - all she has to do is look at it. On the other hand, inline images can be frustrating to scroll through. If you do not wish to send a graphical image inline, you must compress the file before attaching it - Mail, sadly, lacks a built-in compression option, though fortunately for Panther users, the Finder offers Zip compression without requiring a separate application.
    Note that when you compose a new message, Mail always shows attachments in the body of your message. You can manually drag them somewhere else, but many email clients display all attachments in a separate list, regardless of where you place them in the message body.
    If you paste an image into a message or drag & drop an image from another window (say, a Web browser), Mail converts the raw image data to an attachment in TIFF format. On the other hand, if you drag & drop the icon of an image file (or use the Attach button to locate the file using the file browser), Mail leaves the attached image in its original format. This difference is significant, because although most email clients can display JPEG images just fine, support for TIFF - especially in non-Mac email clients - is less common. If possible, I suggest attaching image files as opposed to pasting or dragging in raw image data.

Maybe you are looking for

  • Mm-fi error /critical

    hi, In the past- Whenever Finished Goods receipt takes place (GR is made for FG), FG stock a/c is debited and Cost of Goods Manufactured is credited. In the current mysap version-Consumption FG a/c is credited instead of Cost of Goods Manufactured. K

  • Preparing for upgrade and Unicode conversion while on 4.6c

    We're currently on 4.6c and preparing to upgrade to ERP 2005 and do a Unicode conversion.  I'm trying to compile a list of coding techniques that can used in 4.6c that will minimize changes needed for Unicode.  Does anyone have such a list? Some thin

  • Oracle Prepared Statement - 8.1.7 JDBC type II Driver

    Hi, I have a strange problem. I do a query using a prepared statement and there are no matching results. I change this to hardcoded SQL Statement and pass in the same value a row of record is returned I change this to Statement and pass in the input

  • Playing with servlets

    What the heck is a deployment descriptor my book (java servlets & jsp cookbook pg14) tells me just to copy it from the v2.3 or 2.4 specs as a starting point could somebody please tell me what hes talking abt

  • Xerox Phaser 6110 and Snow Leopard

    Hi there, Please can somebody help? I bought a new imac the other day and connected my three year old Xerox Phaser 6110 printer, and to my shock, it won't print. Thanks to this forum, I found out that I'm not the only one with the same problem. Now,