How do you draw an image into a certain field in applet layout?

i need to to take a image drawn from a function and place it in the "center" field of a borderlayout applet...

Check out the link shown below for a complete example on how to do this:
http://forum.java.sun.com/thread.jsp?forum=31&thread=226875
V.V.

Similar Messages

  • How do you set an image into the background of a JPanel or JFrame?

    How do you set an image into the background of a JPanel or JFrame?

    Something like this, Ive thrown in an ImageIcon on a
    button too for good measure.
    import java.awt.*;
    import javax.swing.*;
    public class JFrameImage extends JFrame {
    public JFrameImage() {
    Container c    = getContentPane();
    JPanel panel = new JPanel(){
                 public void paintComponent(Graphics g)     {
    ImageIcon img = new
    = new ImageIcon("background.jpg");
                      g.drawImage(img.getImage(), 0, 0, null);
                      super.paintComponent(g);
            panel.setOpaque(false);
    ImageIcon icon = new ImageIcon("onButton.jpg");
    JButton button = new JButton(icon);
    panel.add(button);
    c.add(panel);
    public static void main(String[] args) {
    JFrameImage frame = new JFrameImage();
    frame.setSize(200,200);
    frame.setVisible(true);
    Going totally fancy pants
    ImageIcon bigImage = new ImageIcon(bgImage.getImage().getScaledInstance(getWidth(), getHeight(),Image.SCALE_REPLICATE));
    g.drawImage(bigImage.getImage(), 0, 0, this); Will scale the image to the size of the panel
    whereas
    for (int y = 0; y  < getHeight(); y = y + image.getHeight(null))
    for (int x = 0; x< getWidth(); x = x + image.getWidth(null))
    g.drawImage(image, x, y, this); Will give a tiled effect
    Try tiling with an animated gif and bring your processor to a standstill.

  • How do you paste an image into a rectangular marqee forcing it to resize into the marqee?

    How do you paste an image into a rectangular marqee forcing it to resize into the marqee?

    Not sure this would address your issue, but the Crop Tool works that way: set the width and height, plus resolution, and Crop does everything. You could then paste the result into another file if that completes your process.

  • How do you insert an image into a google map using a macbook?

    I am trying to put images into a Google map using my MacBook, but cannot seem to find any help. How do I insert an image into my Google map using my MacBook?

    Nothing complicated with your menu - very clear "ADD Image" but my menus are not as simple. Everytime I need to add an image I spend 5-10 minutes searching again. Wonder why so hard. I generally find Acrobat menus cryptic and unclear and I am big Adobe fan - use Illustrator, Photoshop, Dreamweaver, Premier, Fireworks etc - but Acrobat menus are like calculus in the dark.

  • How do you add an image into an expansion pack display?

    I have the expansion pack and am having a difficult time figuring out how to and an imageinto some of the expansion pack displays, in particular the one tat looks like a TV that rotates from background to center and then back. I would like to add an image or text into the display and have it rotate with the TV .Suggestions???

    If you look at how the TV Set objects work, you will see that the action takes place after the TV comes "on". This happens when the TV is not moving.
    Taking a still image from a rendered movie at this position into a graphics application such as photoshop will enable you to make a mask for the video that you wish to superimpose on the screen. With some judicious use of transparency it should be relatively simple to make it look as though the image is embedded, rather than stuck on.
    If you must have an image displayed while the TV is rotating in, then you need an application that can apply tracking data, such as Motion.
    http://documentation.apple.com/en/motion/usermanual/index.html#chapter=19%26sect ion=0%26tasks=true

  • How do you open an image on the iPad, via Photo Stream, into PS Touch?

    To anyone using an Apple iPad w/ PS Touch.  How do you open an image on the iPad, via Photo Stream, into PS Touch?

    You need to start from PS Touch for this.
    There's two ways either direct in the gallery with the +image icon.
    Or you create a document and use the +image icon in the document view.
    thanks,
    Ignacio

  • How do you draw a tie of two notes in the score editor window

    How do you draw a simple tie in the score editor window of Logic Pro 10 ; two quarter notes together, an eighth up-beat accross a bar line into the next measure etc? I can't find the answer in videos, help manual.  Please give a step by step how to do it.
    It's hard to believe that a program like Logic, that has more information than the New York Public Library, does not have a simple solution for tieing notes. Maybe Logic XI will have one, or "Logicians" can speak to Sibelius for a more "note-worthy" way to solving the problem so that the score editor can be more accessible for editing purposes for those that read and write manuscript. Lew Traver

    Hi
    Ties are generally automatically created as necessary. Simply adjust the length of the note in the Score (using DurationBars or the Inspector), or in the Piano Roll or Event list.
    CCT

  • How Do I Combine Several Images Into One Image Which Contains Links To A Series Of Web Sites?

    How do I combine several images into one such that the combined image contains a series of web links? In particular, I’d like to create such an image and put it into my Outlook email signature. At present, as per the image below, I have at least six separate images in my email signature with each image containing a web link. Is Photoshop the best tool for this job? Or would it be easier to do this in some other package? I have three packages at my disposal: Photoshop, Ilustrator and Dreamweaver. Can someone please explain in detail how I would do this? Or perhaps someone could direct me to a link that explains how to do this. Thank you.

    Thank you for that correction, Hobotor. I admit I hadn't thought about an image map, in the context of someone who doesn't seem to know HTML very well...  My thinking was running along the use of the Photoshop Slice Tool to get most of the way there...
    To expand on the above, if you were to slice up your image using the Slice Tool, say like this:
    Save for Web & Devices will create the HTML and save all the sub-images.
    Then you edit the HTML and add a (hypertext link) elements surrounding the various images.  Only thing is you'll have to set the border-style of the images to none.
    For example:
    <!-- Save for Web Slices () -->
    <table id="Table_01" width="554" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="10">
       <img id="Sig_01" style="border-style:none" src="images/Sig_01.jpg" width="554" height="56" alt="" /></td>
    </tr>
    <tr>
      <td colspan="10">
       <a href="http://www.GrahamsWebSite.com"><img id="Sig_02" style="border-style:none" src="images/Sig_02.jpg"
            width="554" height="43" alt="" /></a></td>
    </tr>
    etc.
    A full copy of the HTML and images can be found here...  View Source to see it as an example:
    http://Noel.ProDigitalSoftware.com/temp/Graham/Sig.html
    -Noel

  • How do you add an image in the signature

    Hi,
    How do you add an image to the signature area.
    The Insert/edit image is not available when in My Settings | Personnel Info | Signature
    Regards
    Ray Farmer

    You need to link the image.  See the example for the Canada flag below.
    <img src="http://forums.ni.com/ni/attachments/ni/130/6908/1/Canada-small.PNG" border=0>
    Replace with the image you like.  This goes into the signature box within the profile tab of the personal settings.
    RayR

  • How can you upload an image to MYSQL using php?

    Ok this is a joint thread with one of my other ones because no one else  was posting on it, so I did not get what I needed, so, How can you  upload an image to mysql so when some one logs on to my site, they see  or can upload there own avatar, now there are loads of problems with  this, 1) many people don't know how, 2) It's not every day you try to  encode a image into mysql, 3) Letting people upload images into mysql  can cause traffic problem with people trying to log in. So that's it.

    Uploading images into MySQL is a bad idea, for more reasons than you mention. You should store the images in a directory on the server instead. But if you want to learn the hard way, here is the method:
    The mysql data type must be blob.
    The form enctype must be multipart, like this: enctype="multipart/form-data"
    The form input field myst be type file, like this: <input type="file" name="upload"/>
    Here is example code that prepares the variable $photodata to be inserted into the database.
      $uploadfile = $_FILES['upload']['tmp_name'];
      $photoname = $_FILES['upload']['name'];
      $uploadtype = $_FILES['upload']['type'];
      if ($uploadfile != "") {
    $tempfile = fopen($uploadfile, 'rb');
    $filesize=filesize($uploadfile);
    $width=getimagesize($uploadfile);
    $widthx=$width[0];
    $heightx=$width[1];
    if (($widthx > 102) or (heightx > 135)){
    $image_too_big = " but the image size was too large and was not submitted.";
    } else {
    $photodata = fread($tempfile, filesize($uploadfile));
    $photodata = addslashes($photodata);

  • 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 would you draw a soccer goal?

    Hi guys,
    this might be really basic for the pro's out there, but I'm
    just a beginner with Fireworks.
    Basically, I'm trying to draw a soccer goal (at least the
    frame of it) making it look like metal. There are styles that
    provide this sort of finish in Fireworks, however, the problem is
    that I cannot come up with a shape for the purpose. If I just draw
    three lines (post, crossbar, post), and apply metal finish to them,
    they look cut off and not very nice. But a rectangular box
    obviously has the bottom line too much.
    How do you do that??
    Thanks for any tips,
    Jan

    Hmm.
    I did a Google search for images of soccer goals. I guess it
    depends on how stylized you want your image to be, or how
    realistic. I think a fairly realistic image would be on the
    difficult side.
    The tricky thing is that you're trying to represent something
    that is made of pipes (usually round), so you need to indicate this
    volume with shading. The shading on the crossbar won't be the same
    as the shading on the uprights. I also noted the welded joints
    where the crossbar attaches to the uprights. Somehow, you need to
    indicate these seams. Another thing that might help you is to use
    an angle which is not straight on. Perspective enhances realism.
    Many of the images I saw showed goals that have more pieces than
    just the uprights and crossbar, either at the top or the bottom to
    hold the net. Then, of course, there's the net. These details will
    help make your image look more realistic, and more like a goal. The
    metallic finish would really be the last thing to add realism. You
    need to get the shapes right, first.
    Before trying to draw a goal, study real ones. Here are a
    couple of different goals:
    goal
    post from rectangular pipe
    goal
    post from round pipe
    And...here's the
    Google
    search for soccer goal images.
    Good luck!

  • How do i bring an image into photoshop?

    how do i bring an image into photoshop?

    Additionally, if you've copied an image from a website or other location, you can go to File > New and, for CS6, at least, the canvas will already be the dimensions of the image you have in your clipboard. So, once you start that new file, you can simply go to Edit > Paste (or hit cmd V) to drop in the image.
    Please let us know if we can assist you any further.

  • How do you insert a picture into another picture?

    How do you insert a picture into another picture.  For example, one person is missing from family photo & I'd like to insert that person's face.

    By using an external editor:
    In order of price here are some suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate. You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • Could any one tell me how to divide a BMP image into pixel blocks

    I am new in Java, Could anyone please show me how to block an BMP image into segmented blocks. Please help.

    could you be a bit more specific? What segmented blocks are you talking about? Is the width and the height of these segmented blocks givenby the user or does it have to be equal blocks of the whole image?

Maybe you are looking for

  • Using ADF View object create method in Data Action

    I need to know how to create a new row in an application module method and get the attributes from the ADF input form. If i Drag drop the create method in the data action form it is working fine. But how to do this programmatically, I have a need whe

  • Error message when syncing Ipad in itunes: unable to load data class

    Hi there: I t tried posting this question on the ipad community but no luck. What happened last night I was trying to sync/backup my ipad 2 running ios 5.0.1 with itunes 10.5 (?) for over an hour.  It stuck on step 2 of syncing ipad and it's been on

  • Validate a file exists

    I am using the file upload control and I have searched these forums unsuccessfully for the answer to my question; How do you validate a given file path exists on the local machine? i.e., if someone enters c:\my_file.txt how can I validate that there

  • IE6 to IE7 or IE8 compatability issues

    Hi, Now we r working on portal(EP 7.0) with IE6, working fine for All SSO and non-SSO , according to user request we r planned to change IE7 or IE8. I tested with IE7 and IE8 I found some problem's like below 1)  when the user clicking one iview(non-

  • Accidenally uptated to ios 8.1.2 on ipad air.

    Hi. My Granddaughter accidentally updated to ios 8.1.2 on to my ipad air 16 GB, this I dont't really want as it is taking up more memory.  When I tap on the iso 8.1.2 icon it gives me an option to "Delete Update" this is in red, Question :- can I del