Putting image on Frame in netbeans

Dear All
How can we add an image on frame in netbeans IDE.
From
Rajeev Sarawat

you have to create one class in the same project for the main panel(name it as MyPanel) then go to "customize code" of main panel and instead of default creation do custom creation of the main panel.
here is the code for MyPanel----
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.image.*;
import javax.imageio.*;
import java.awt.Graphics;
import java.io.IOException;
import java.io.File;
* @author Administrator
class MyPanel extends JPanel {
BufferedImage image;
String file;
public MyPanel(String s) {
setBorder(BorderFactory.createLineBorder(Color.black));
file = s;
public Dimension getPreferredSize() {
return new Dimension(711,360);
protected void paintComponent(Graphics g) {
super.paintComponent(g);
try
image = ImageIO.read(new File(file));
}catch(IOException e)
System.out.println(e);
int w = image.getWidth(null);
int h = image.getHeight(null);
BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
g.drawImage(image, 10, 20, null);
i think it would be helpful

Similar Messages

  • Putting images into frames

    I'm making diamnond shaped frames to put images in and I need some help. I'm making a square and rotating it but the image rotates as well. How do I do this? I have indesign CS5. Thanks!

    Thanks! I'm attaching a screen shot. I'm trying to duplicate the pdf that's on the right. Thanks again!

  • How to put image in Frame?

    How do I paint images (gif/jpg) in Frames?
    getCodeBase(), "... command doesn't work in Frame
    the getToolkit stuff to get images compiles, but my image doesn't show up. What can I do now?
    This is a part of a larger class.
    class Win extends Frame{
    Image helpD = Toolkit.getDefaultToolkit().getImage("icon.gif");
         Image img;
         Graphics helpG;
    Win(String name)
    setSize(455,455);
    setTitle("Instructions:");
    setResizable(false);
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent evt)
    dispose();}
    public void update(Graphics g) {
         paint(g);
    public void paint(Graphics g){
              img=createImage(455,455);
              helpG=img.getGraphics();
    helpG.drawImage(helpD,0,0,this);
    g.drawImage(img,0,0,this);
    Does the getTookit stuff has some image restrictions?
    Thanks,
    Gant

    Is this what you're after? JFrame jf = new
    JFrame("Title");
    jf.add(new JLabel(new ImageIcon(img)));
    No, that's addin a ImageIcon. I want to place a gif/jpg background image in the window frame.

  • I had completed my iDVD project and burned a disc. It worked great! Then someone messed with the project and put a red frame around the opening screen. Now when I burn the project, it no longer has the opening frame. How can I fix?

    I had completed my iDVD project, a Wedding Slideshow with pictures and music, and burned it on a disc. It worked great! Then someone messed with the original project on my computer and clicked around and put a red frame around the opening screen that has the Wedding theme with music. Now when I burn the project to make more DVDs, it burns but no longer has the opening frame. It immediately opens to the iMovie slideshow. How can I fix so I can burn the entire project with opening frames?

    As Bengt suggested make a disk image of the successfully burned DVD using Disk Utility. Then you can burn copies any time you need one.
    In the future once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image menu option.  This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image and launch DVD Player and play it.  If it plays OK with DVD Player the encoding was good.
    You can then burn it to disk with Disk Utility at the slowest speed available to assure the best burn quality.  Always use top quality media:  Verbatium, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • IMovie '11, still images as frames for time lapse problem

    As strange as this may seem, I cannot find a way to change the stills I import to just be 1 frame each in iMovie '11.  That is, I have 30 still images (a time lapse) that I want to put together for a 1 second sequence (i.e. 30 frames per second).  The slowest I can seem to get is down to is 1 frame per second which gives me a total time of 30 seconds, which makes it useless.
    Are still images able to be set to 1 image per frame? Am I missing something?
    Thanks for any help you can provide.
    -Matt

    You can do this in iMovie but it is quite cumbersome.
    Long-time contributor Jon Walker created this Video Tutorial to show how to do this.
    The Tutorial is for iMovie 08, but I verified that it still works for iMovie 11.
    There are better tools for Stop Motion, including iStopMotion and QuickTime Pro. After doing it in iMovie, you may see why.

  • Need advice. Is it necessary to put images in folders and subfolders with LR?

    It seems that the concept of spending hours putting files into folders, sub-folders and sub-sub-folders is not needed  with LR. Creating all these folders takes hours, especially if you are like me and need a major reorganization of image organization. My thought is that all images can go into one massive folder as long as they are properly tagged. I can then use LR Smart Collections to essentially virtually organize all my images. I can create many more sorting options using Smart Collections than I can by putting images into a folder. This flies in the face of everything I've learned about storing data on a computer so I'm nervouse to head this direction because it starts with unorganizing my folders and removing all tags so I can start fresh.
    I don't want to take this on only to learn I didn't think of a gotcha issue. One drawback is that you are now committed to find anything by using LR or tags only. What do you think?

    Lee Jay wrote:
    Okay, then be honest.  What would you do if you were me?....So - give me an honest recommendation on a go-forward path (no "coulda, woulda, shoulda's").
    Honestly, I always start off from assessing what you really need or what value you could get from keywording. I wouldn't advise you to add keywords for their own sake.
    Lee Jay wrote:
    Meanwhile, I can already find all my images efficiently in seconds in nearly all cases.  I estimate that there is about one situation per year where having a comprehensively keyworded image store would be helpful in saving me time - perhaps 15 minutes each time that happens.
    Let's pretend that this isn't quite as black and white as you always put it. Let's say we're mainly talking weddings - typically wedding photographers add few keywords, if any. And let's say you do need to find certain images more often - each time you go to meet prospective clients you want to put on your iPad (you?) a portfolio of your best work for their broad type of wedding. So you might have categories like indoors / outdoors / subaqua, particular venues, age groups, religions through humanist,  formal / weird. Let's assume you do judge it worthwhile to increase the number of keywords.
    Lee Jay wrote:
    I could start tagging images now as I collect them.  But then I'd have all those other images that aren't tagged and all the new ones that are.  That means using the smart-collection approach would mean all the new ones were in neat collections, and all the old ones were in a gigantic "untagged" collection with over 100,000 images in it.
    Actually, that is the way I would advise you to go. Don't let the perfect be the enemy of the possible. It's not at all uncommon that people are put off beginning doing some keywording by the scale of the complete task. But beginning with the images that you're currently working on isn't too much extra effort. Even if it turns out that you never eventually do go back and keyword the old stuff, in a year's time you'll have a whole year's worth tagged. While doing so you'll probably adopt ways to make keywording less of a chore. For example you might add metadata presets to slap on overall keywords for the typical shoot "Wedding, Ceremonies, Christian" and then one or more keyword sets if you can justify putting time into varying the keywords between images - eg Bride, Kids, Cake. I wouldn't waste any time building up a hierarchy (do if you want, or not if you don't).
    I simply wouldn't worry about the 100,000 remaining untagged - they'll be easier to tackle once you're you've got the experience / benefits from keywording new stuff. I'd advise you to do it only as and when you need - it's too big a task to do anything else. Let's say you need your best shots of Jewish weddings and - as you're currently keeping a lot of metadata in your head - you know some are in that untagged mass. Find them through the folder system as you do now, whack on some keywords like "Wedding, Jewish, Non-orthodox". All those shots are of the bride - whack on "Bride" (maybe from a keyword set). Hey, she's got an obvious tattoo - let's just add that keyword just in case it'll be useful. And quickly move on. Whatever seems worthwhile.
    Although scripting could help, where's the script? Worthwhile to write/adapt one yourself? Instead for folder names I'd just just smart collections to gather image - eg folder name contains "weddings" - and then slap on the keywords. Sure, there will be some duplication between the pseudo-metadata in the folder names and in keywords, but duplication happens with metadata. In fact, it'll be quicker to search by the keyword "Wedding" than search for images with the keyword "Wedding" and / or with the folder name containing "Wedding".
    So that's how I'd advise you - start with the new work, and deal with the older stuff ad hoc.
    John

  • Quality issues when importing still images as frames for animation

    hello,
    i've imported roughly 600 hand-drawn and scanned (600 dpi) images as frames for video. the images themselves are really crisp and perfectly how i want them to appear. i've imported each to play for 2 frames then move to the next. once done, i save this video file as an .avi. i then repeat the process in order to layer the video (using Calculations filter) over and over again, to fill up the screen with overlapped, layered animations. in theory, these layers should all remain crisp, just like the scanned images. i was under the impression that the standard Export... > Movie... .avi file is essentially lossless and is best for editing, however when my process is completed, the final product is muddy, grainy, and pixelated. i'm not sure where i am going wrong, as i've actually done this process before with success.
    is there a way to specific the working file as "high definition" or something similar so that the quality is just as crisp as the scanned images i am using as source
    any help is appreciated - i am completely self taught in video editing and it is really bugging me that the file output is not how i envisioned.
    thanks,
    DB

    I note you specified that the images were 600 dpi.  The dot per inch are an issue only for printing a hardcopy.  For video work, the issue is the pixel dimensions and the pixel aspect ratio. If your image is 600 pixels by 400 pixels with a PAR =1.0. If your sequence is 1440 x 1080 with a pixel ratio ratio of 1.33, then the images must be the same and PrPro must scale up the image.  You can get good images from imported stills in PrPro. I prefer to rescale my images using Photoshop.  I am told that the scaling algorithm in PrPro has been improved.  But regardless, if you are scaling up, you will see degradation becauae Prpro has to interpolate between pixels to fill the video frame.

  • How to put images on graph?

    Hello,
    I want to put images on graph whereever I want.
    I have TDMS file like this.
    My "x Axis" is (km) and "y axis" is MKTY.  If MKTY is 3 I want to put image3 on graph places in the y-axis. If MKTY is 2 then I put "image2" on graph.
    I uploaded my TDR file.
    Yasemin Barutçu
    Electrical And Electronics Engineer
    Attachments:
    graph.zip ‏5 KB

    For me, not. But yes I have to do this. Maybe I manual have a table which includes the y axis coordinates. X axis is dicrete then when I get the value 2 I will look at its y axis and take the coordinates of the y-axis corresponds to the table
    Is it difficult? 
    Yasemin Barutçu
    Electrical And Electronics Engineer

  • How draw image into frame in applet

    How draw image into frame in applet.Please give my simple example code.

    http://search.java.sun.com/search/java/index.jsp?qt=%2Bdraw+%2Bimage+%2Bpanel+%2Bhow&nh=10&qp=&rf=1&since=&country=&language=&charset=&variant=&col=javaforums

  • Where to put images in web Dynpro project to have them deployed?

    Hi Brothers,
    I would like to show an image in an <img>-tag within a Formatted Text View UI Element.
    I have created a folder img under src/.../projectname and I have referenced the image in the <img>-tag as follows:
    < img src="/LocalDevelopment~LocalDevelopment~testroadmap~demo.sap.com/src/packages/com/sap/demo/projectname/img/newRow.JPG"; /.>
    However, the image is not shown in the Formatted Text View UI Element.
    Does anybody know where to put images so that they are packed in the .war achieve and deployed and how to referenced them?
    Thanks, Johannes

    Hi,
    place the image in the following folder of application,
    src\mimes\Components\<your component name>.testroadmap.demo.sap.com
    If you store the image file in your Web Dynpro project under src /mimes /Components /<Name of Component>, you only have to specify the file name without a path.
    Regards,
    ramesh
    Edited by: Ramesh Babu V on Sep 19, 2008 1:58 PM

  • I have made flash cards on my ipad.  I am trying to put images on them.  How do I do this?

    My daughter is working on a project for school.  She has made flash cards and is trying to put images onto them... She has taken the pictures using her camera.  Now what does she have to do to put the pictures onto the flash cards?
    Thanks!!

    She says she used Ifree Flash Cards???  I don't know anything about the IPad.  I did however try to copy and paste but I guess it doesn't work the same as on a computer??? 
    Everytime we tried to copy the photo all it will do is make an extra copy?
    Thanks for your answer and any help.

  • In formscentral, can I put images in dropdowns

    I need to put images into drop-downs in the formcentral form design.  Am I able to do this?  How?

    Thanks, but it should be!
     Ken Banner
    0lllllll0
    home: 336-856-1461
    mobile: 336-895-8305

  • When I  put apps from my PC to my iPhone it copies it but it doesn't install in my phone??? I just my iPhone 5s so when i put images from my laptop I cant delete them so can you help me??

    When I  put apps from my PC to my iPhone it copies it but it doesn't install in my phone??? I just my iPhone 5s so when i put images from my laptop I cant delete them so can you help me??

    You might not have enough space on your phone. 
    Look on iTunes and see how much space the photos you copied over is consuming.

  • Can image data frames is shown at the rate of 30frames/sec, will it replace video. If so how?

    Actually I dont have camera to acquire video signal, while I have to work on video compression technique H.261. I just wanted to ask that if I dont have camera, can I use the image data frames at the rate of 30frames/sec to show like video or can you suggest any other alternative?.
    What labview library supports video compression?
    Any example of implemented technique of video compression if any one can suggest?
    Thanks in anticipation

    Hi @info,
    I would suggest you take a look at the Sequence and Save to
    AVI.vi example.  This can be found by
    searching the example finder for AVI. 
    From the sounds of it this example dose very close or exactly what you
    would like to do. As for the compression question I would suggest looking at
    the AVI Compressor Comparison.vi
    Message Edited by Adam_H on 05-28-2008 06:22 PM
    Adam H
    National Instruments
    Applications Engineer

  • Cant put image on top of another image

    Hi,
    I'm using keynote 09 with the 'Blueprint' theme. I'm attempting to edit the master slides by putting a company logo in the corner of each slide. This works fine on slides without images, but on slides with images, keynote will not let me put my logo over the image placeholder. The placeholder image always blocks my logo, even when I choose 'Send backward' on the place holder.
    Is there a way around this?
    thanks

    Sorry, I was typing fast.
    The problem is that you cannot put images above media placeholders on master slides. One suggestion was to make my image (my logo comprised mostly of white text) a media placeholder as well, therefore I could edit the master slide and layer my new media placeholder (logo) above the default-already-existing placeholder (some architectural image in the blueprint theme).
    This works but has an additional problem.
    Since my logo is white text, I wanted for it to stand out from the picture beneath it. As I sometimes do, I thought I should place my white-text-logo on top of a small black rounded rectangle with transparency (like a cartouche).
    I like to do that because it makes my logo legible, while still showing the picture through the transparency. INdeed, this is easy to do if you are only dealing with pictures and shapes (and not the magical placeholder versions of them)
    You can make the shape a text placeholder, and you can make the image (logo) a media placeholder, but you can't group the two together as a unit. And if you group them first, then you cannot make your group (shape+image-logo) a placeholder at all, so you then cannot layer it on top of the default image place holders.
    I was saying that I'd have to open my logo in photoshop and put it on top of a 'cartouche' and then import that modified image, and THEN make it a media placeholder.
    But obviously it would be easier if keynote just let us properly layer elements as you would expect it to work.
    I mean, setting images aside, why can't I create a shape and put it in front of a media placeholder without making the shape a text placeholder?
    Of course I can edit my logo and add dropshadow or glow to make it stand out, but even then, I would need to make it a placeholder before keynote would let me layer on top of another placeholder. And if I'm going through the trouble of using photoshop to add shadows or glows, I might as well just put the image on top of a cartouche as originally desired.

Maybe you are looking for