Show a picture in a frame

Please Is there somebody who's help me out?
I'd like show a picture thats have an extension like .jpg, How Can I do this? My email is [email protected] or [email protected]
Thanks.

I would read up on the basic Swing tutorials. In the mean time, here is a good example:
import javax.swing.*;
import java.awt.event.*;
public class TheBigOne {
  public TheBigOne() {
    //does nothing!
  public static void main(String[] args) {
    System.out.println("Starting...");
    JFrame theBigOne = new JFrame("Test Window");
    theBigOne.setDefaultLookAndFeelDecorated(true);
    ImageIcon pic = new ImageIcon("C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Winter.jpg");
    JLabel p = new JLabel(pic, JLabel.CENTER);
    p.setOpaque(true);
    theBigOne.setLocation(0, 0);
    theBigOne.getContentPane().add(p);
    theBigOne.pack();
    theBigOne.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    theBigOne.setVisible(true);
    System.out.println("Ending...");
}  Hope that helps you get started.

Similar Messages

  • How to show a picture in a frame?

    I've created a class to create some frames and i'm trying to show these pictures on the frames using this class.
    Can someone help me or give me an example?
    Thanks
    Alex

    hi,
    you should override the paint method and then in the paint method do a g.drawImage(image, xPos, yPos, null); where g is a Graphics object, image is an object of type Image, xPos and yPos are the x coordiate and y coordinate locations where the image is to be drawn on the frame.
    eg
    public void paint(Graphics g)
          g.drawImage(image, xPos, yPos, null);
    }hope that helpz
    cheerz
    ynkrish

  • How can I show 2 pictures in one frame either in an IPhoto '11 slide show or IMovie '11

    I'm trying to put two pictures side by side in one frame of either a slideshow or movie (for my brother's wedding, a picture of him and his fiance at the same time in their lives growing up)-how can I do this?  I have tried PIP in IMovie, but I'm not having much luck.

    Bizarro:
    Welcome to the Apple Discussions. JMEH has suggested the best way to get what you want. Create a blank 8.5 x 11 canvas at the dpi size that your camera produces. Mine Canon gives me 180 dpi. Then, using PS as iPhoto's primary editor, crop the file to the size you want and drag it into the open blank canvas and position it where you want. Just make sure in PS that the dpi is set to 180 (or whatever you choose to use). Once dragged into the blank canvas the changes to the file, i.e. crop, does not have to be saved and you can close that file without making any permanent changes. Do that for each of the photos you want on the blank canvas, arrange and print. When done you can close the canvas without saving for use the next time.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • ------Transition glitch - shows blink cuts of other frames.........

    Hey guys,
    I'm almost done wrapping up a marathon of a video series I'm putting together and just started applying
    transitions = one of the last elements in my editing...
    I've been looking everywhere for solution to the issue I'm about to describe but haven't found anything...
    The issue/glitch is after I apply a transition - such as a cross dissolve......the cross dissolve doesn't
    just go from one cut to the next...it includes a "blink" split-second glimpse of a seemingly random other frame
    somewhere else in the video ---- one or two or three cuts back or forward (frames that have nothing to do
    with the transition b/ one cut to the next in which the transition was applied)...
    It does this for every transition that I apply...
    Here's what it looks like --- the first pic is the frame I'm transition from......the second pic
    is the weird glitch I'm talking about.......and the third pic is the next frame I'm transitioning to...
    So number #1 and #3 pic's should be there...but not #2...
    What the hell is this and do you have a solution - I need to get this fricken series done and I've
    had enough of these little glitches/problems you have to deal with.......can I get an AMEN??!!
    Thanks!

    Ok...thanks for you help guys...I think I've found the method to it's madness...and the way I interpret your input so far...it's not what you're talking about - therefore I don't have a solution...but could be wrong so let me know...
    My video consists of both Live Video and ScreenCasts -- as mentioned before...
    The glitch isn't occuring with the Live Video transitions...
    My ScreenCasts consist of PowerPoint ScreenCasts and Website ScreenCasts...this is where the glitch is occuring and the method to it's madness seems to be that the "blip/blink" frames that are showing up (pictured above) consist of a previous ScreenCast...so for example...
    I have a ScreenCast video of "ABC" site...then the next cut or video is a PowerPoint ScreenCast...then the next cut or video is another ScreenCast of "DEF" site... =========== so I have one PowerPoint ScreenCast in between two Website ScreenCasts...
    The "blip/blink" frames that are popping up between the two scenes consist of "ABC" site ScreenCast...
    Does this make sense?
    Any suggestions as to how to fix...?
    Thanks so much

  • HT4623 my iphone 3 when turned on shows  a picture of the jack and an arrow pointing to Itunes. I can't get it off this screen. help!

    my iphone 3 when turned on shows  a picture of the jack and an arrow pointing to Itunes. I can't get it off this screen. help!

    Do what you are being told. Plug the phone into a computer running iTunes and restore the phone.

  • I want to play music from my playlist when I am using slideshow of my pictures in Ipad,  but I can only choose ONE SINGLE song, and it continuously repeates itself.  Is there a way to play the complete playlist while showing my pictures?

    I want to play music from my playlist when I am using slideshow of my pictures in Ipad,  but I can only choose ONE SINGLE song, and it continuously repeates itself.  Is there a way to play the complete playlist while showing my pictures?

    You can start the playlist playing in the iPod app and then switch into the Photos app and start your (non-music) slideshow - as you've found out you can currently only select a single track in the Photos app. Whether that will change in iOS 5 I don't know, but you could try leaving feedback for Apple : http://www.apple.com/feedback/ipad.html

  • A few days ago my TV show and movie displays went whacky-the shows are no longer in alpha order, there are multiple listings of the same show, the pictures are random-including album covers.  I downloaded latest version.  Any ideas??

    A few days ago my TV show and movie displays went whacky-the shows are no longer in alpha order, there are multiple listings of the same show, the pictures are random-including album covers.  I downloaded latest version & no change.  Any ideas??

    ME TOO.
    I think mine are all still in alphabetical order, but :
    * movies I deleted from my library and told "hide this purchase in the cloud" are showing up again. If I try to play them, I get the "cannot find the file in its proper location, would you like to locate it" error message.
    * for movies that have "iTunes Extras," the extras show up as a separate item, with another copy of the movie artwork. Most of these I believe I had DELETED the "iTunes Extras" anyway.
    * Items are showing up multiple times.
    * A few MUSIC ALBUMS are listed in my Movies section.
    * Some movies (I believe ones that I deleted off my HD but are still in the cloud) are showing random album covers instead of their proper artwork.
    * Just rented a movie, and it didn't show up anywhere in my library. It downloaded properly and completely, was in a suitably labeled folder in my iTunes/Media/Movies section, but didn't show up in any section of the library (or via a library search). Had to manually find it and tell it to open the file using iTunes.
    Running the latest version, even checked for updates. No other changes made lately since the last round of apple software updates. This was wonky before the latest small update to iTunes - now it's even wonkier. And it is very, VERY effing annoying.

  • Blog summary didn't show the pictures

    Hi
    when i add new entry in blog page with photos,the page of blog summary didn't show the pictures and i already Selected " SHOW PHOTOS".
    http://www.djpapa.me/blog/blog/blog.html <-- this is my web page
    Thanks in advance
    Djpapa

    Michael Spencer wrote:
    BTW: original question indicates 2 helpful and 1 solved on this question but darn if I can find those three posts; anyone?
    Michael ~ You missed mentioning the key word "available":
    ""Helpful" answers available: 2 . "Solved" answers available: 1 ."
    ...It doesn't mean there are Helpful or Solved answers available +to view+, rather it means what options the thread originator has of marking a reply as either Helpful or Solved, which will add points to the respondent's account. Every topic marked as a question starts out with the situation quoted above — and as the originator marks replies, so the number of answers "available" for points is reduced. Read more here:
    http://discussions.apple.com/help.jspa#answers

  • How to show a picture both on client and server at the same time (X11?)

    Hi Guys
    I want show a picture on my client as well as on the server(in another location) at the same time, pretty much like showing something both on laptop and on a projector. Assume I have a picture sssss.jpg on the server A1, if I want to open that picture to my client, I can simply to do the following from client A2:
    xhost A1
    telnet to and login A1
    setenv DISPLAY "ipaddress of A2":0.0
    Anyone can direct me how to show picture the client that I am sitting at an also show on the server at the same time?
    Thanks

    VNC would let you do that. With a shared connection, both machines could run a VNC client to the same session.
    Darren

  • How to Insert picture in Database & how to Show this picture in Report/form

    Hi
    I have create a table and want to insert picture in this table in Blob format and also want to show this picture in Form / Reports
    Regards
    Shahzaib ismail

    Hi Shahzaib,
    create table
    graphics_table
    bfile_id number,
    bfile_desc varchar2(30),
    bfile_loc bfile,
    bfile_type varchar2(4)
    SQL> INSERT INTO graphics_table
    2 VALUES(4,'April Book of Days Woodcut',bfilename('GIF_FILES','APRIL.JPG'),'JPEG');
    1 row created.
    In this way you can inserrt picture inside the database.
    Regards
    Rajat

  • Why doesn't the poster image show up as the first frame of my movie?

    I am new at this and maybe misunderstand the Help screen. I have a bunch of short movies which I have laid out in iWeb and published to my iDisk. I want them to load with a still image from the movie rather than show up as a black frame. The meager Help info says to drag the playhead to the desired frame and then Set Poster Frame. I have done that and saved the file and then brought that into iWeb. But then the movie loads with the start point at that frame instead of at 00:00. If I do a Set Poster Frame and then pull the playhead back to zero and save it simply loads a black box again.
    What step am I missing or I am using the wrong procedure altogether?

    Try to check here.
    http://docs.info.apple.com/article.html?artnum=303593
    http://www.mac.com/1/learningcenter/Modules/LHTSolve_t4.html

  • My Iphone5 does not show the picture location after upgrading to ios 7.0.4 - why?

    my Iphone5 does not show the picture location after upgrading to ios 7.0.4 - why?

    I change Settings>Privacy>Location Services>Camera to OFF and then ON and the locations start to appear !!!!.
    It seems to be Apple bug.
    Thanks for you efforts

  • My ipod touch is stuck on a screen that shows a picture of the USB cable with an arrow to "itunes" and pic. of a CD with a music note over it....what do I do?

    My ipod touch is stuck on a screen that show  a picture of the USB cable with an arrow to a picture of a CD with a music note over it.  I have reset and turned on and off.....what do I do??

    Connect it to iTunes and restore it.
    B-rock

  • TS2634 My friends sd card reader no longer shows the pictures after updating to ios 7, is there a fix?

    My friend has an ipad, and after updating to ios 7.0.2 the sd card reader that came with it no longer shows the pictures... just squares where the pictures would be. Is there a way to fix this?

    @ Settings>iCloud
    1. Icloud account being used
    2. I see the following switches
    >mail
    >contacts
    >reminders
    >safari
    >notes
    >keychain (not a toggle switch)
    >photos (not a toggle switch)
    >find my iPhone
    3. Storage & Backup
    delete account option

  • How do I enforce "Show My Picture" instead of "Hide My Picture" in Lync Server 2013?

    I was scouring TechNet and the web for a script that could perform the same task as one that I previously used for Lync 2010.
    In Lync 2010, we had already used Lync policy to enforce that only the Active Directory photo could be used. One thing that we couldn't set via policy however was the ability to complete remove the "Hide My Picture" option in Lync 2010 client.
    This left users with the ability to freely switch between showing the Corporate photo or no photo. I did eventually find and make use of script that constantly checked for this setting switch, then switched all users back to the desired "Show My Picture"
    setting. I don't recall who wrote it, but it's easy to find on technet. As we started to move more and more users to our Lync 2013 enterprise pool, I noted that even though the script was running, the setting seemed to be changeable. A closer look revealed
    that the script didn't function correctly against SQL for our 2013 pool.
    I took the concept and applied it to Lync Server 2013 after studying the differences in Userdata. In Lync 2013, because UserData is in .zip, you need to convert it to 2010 format XML to use logic intended for Lync 2010. My script will extract 2013 data,
    convert it to 2010, query for users who are set to "Hide My Picture" and then export any guilty users to an edited2010 XML. The script then converts this to 2013 Format .zip, and uploads the data for these users only. I chose to use Update-CSUserData
    insted of Import-CSUserData as this avoids having to restart my Front End. I then use a scheduled task on my Front End server which runs this script every hour.
    Please note: You can use this script, but I guarantee nothing about it's functionality, and I am not responsible for how you positively/negatively use it. You should always test things in a Lab Environment. Furthermore, this script was run on a relatively
    smaller Enterprise system in which we are by default set to "Show My Picture" and already assigned as part of our user policy the ForceADPhoto attribute. This means that running the script is less intensive on my FE than say on a FE with 10,000 users
    where none of the users were set to "Show My Picture". Please keep this in mind when planning to execute against your FE. You may want to edit my script and insert the -UserFilter or -WhatIf in the Export-CsUserData UpDate-CsUserData.
    Anyways, I hope this solves the similar issue for many of you Lync 2013 administrators. Please feel free to share my work with others if it does, and also give this post some good feedback and/or mark my post as the answer to your problem.
    Alas, here's the script (save it as a .ps1 , i.e. ForceShowMyPicture.ps1)
    #Lync 2013 ForceShowMyPicture - Compiled by Octavio A. Serpa (Octavio-Admin on TechNet)
    # Import Lync Module
    Import-Module “C:\Program Files\Common Files\Microsoft Lync Server 2013\Modules\Lync\Lync.psd1"
    ###Variables To Set
    #This variable is a folder where files will be temporarily written
    $folderPath = “C:\Lync2013Scripts\Export”
    #This is the FQDN of the pool in which the users you want to target reside
    $poolFQDN = “<lyncpool.domain.local>”
    ###Done
    #Message Out
    Write-Host -ForegroundColor YELLOW “CHECKING THAT TEMP EXPORT FOLDER PATH EXISTS"
    If (-not (Test-Path "$folderPath" -pathType container))
     "ERROR: Your Export Directory doesn't exist!"
     Exit
    Write-Host -ForegroundColor Green “TEMP EXPORT FOLDER DOES EXIST"
    Write-Host -ForegroundColor YELLOW “PRE-CLEANING OLD EXPORT/IMPORT FILES"
    If (Test-Path "$folderPath\Lync2013UserData.zip") { Remove-Item "$folderPath\Lync2013UserData.zip" }
    If (Test-Path "$folderPath\Lync2010UserData.xml") { Remove-Item "$folderPath\Lync2010UserData.xml" }
    If (Test-Path "$folderPath\Lync2010EditedUserData.xml") { Remove-Item "$folderPath\Lync2010EditedUserData.xml" }
    If (Test-Path "$folderPath\Lync2013EditedUserData.zip") { Remove-Item "$folderPath\Lync2013EditedUserData.zip" }
    Write-Host -ForegroundColor Green “PRE-CLEANING COMPLETED SUCCESSFULLY"
    #Message Out
    Write-Host -ForegroundColor YELLOW “EXPORTING LYNC 2013 POOL USER DATA”
    Export-CsUserData -PoolFqdn $poolFQDN -FileName $folderPath\Lync2013UserData.zip
    Write-Host -ForegroundColor Green “EXPORT COMPLETED SUCCESSFULLY"
    #Message Out
    Write-Host -ForegroundColor YELLOW “CONVERTING LYNC 2013 USER DATA TO 2010 FORMAT”
    Convert-CsUserData -InputFile "$folderPath\Lync2013UserData.Zip" -OutputFile "$folderPath\Lync2010UserData.xml" -TargetVersion Lync2010
    Write-Host -ForegroundColor Green “CONVERSION COMPLETED SUCCESSFULLY"
    #Message Out
    Write-Host -ForegroundColor YELLOW “CHECKING THAT FORMAT CONVERSION WAS SUCCESSFUL AND .XML EXISTS”
    If (-not (Test-Path "$folderPath\Lync2010UserData.xml" -pathType leaf))
     "ERROR: Verify that $folderPath is writable!"
     Exit
    Write-Host -ForegroundColor Green “CONVERSION COMPLETED SUCCESSFULLY"
    #Message Out
    Write-Host -ForegroundColor YELLOW “LOADING XML”
    $d = [xml] (Get-Content "$folderPath\Lync2010UserData.xml")
    Write-Host -ForegroundColor Green “XML LOADING COMPLETED SUCCESSFULLY"
    #Message Out
    Write-Host -ForegroundColor YELLOW “CORRECTING AD PHOTO SETTING”
    $changes = 0
    $lastProcessedUser = $null
    foreach ($hr in $d.HomedResources.HomedResource)
     $found = 0
     foreach ($c in $hr.Containers.Container)
      foreach ($p in $c.Publication)
       If ($p.CategoryName -eq 'contactCard' -and $p.InstanceNum -eq 6 -and $p.Data.contactCard.displayADPhoto -eq 'false')
        If ($hr.UserAtHost -ne $lastProcessedUser)
         "$($hr.UserAtHost) reset"
         $lastProcessedUser = $hr.UserAtHost
        $p.Data.contactCard.displayADPhoto = 'true'
        $p.Version = (([int] $p.Version) + 1).ToString()
        $p.PrevPubTime = $p.LastPubTime
        $p.LastPubTime = (Get-Date -Format s).ToString()
        $found = 1
        $changes++
     If ($found -eq 0) { [Void]$d.HomedResources.RemoveChild($hr) }
    Write-Host -ForegroundColor Green “AD PHOTO SETTING CORRECTIONS COMPLETED SUCCESSFULLY"
    #Message Out
    Write-Host -ForegroundColor YELLOW “Changes: $changes"
    If ($changes -ne 0)
     #Message Out
     Write-Host -ForegroundColor YELLOW “RE-SAVING XML”
     $d.Save("$folderPath\Lync2010EditedUserData.xml")
    #Message Out
    Write-Host -ForegroundColor YELLOW “CONVERTING LYNC 2010 .XML BACK TO 2013 .ZIP FORMAT"
    Convert-CsUserData -InputFile "$folderPath\Lync2010EditedUserData.xml" -OutputFile "$folderPath\Lync2013EditedUserData.zip" -TargetVersion Current
    #Message Out
    Write-Host -ForegroundColor Green “CONVERSION BACK TO 2013 .ZIP FORMAT SUCCESSFUL"
    #Message Out
    Write-Host -ForegroundColor YELLOW “IMPORTING LYNC 2013 POOL DATA FOR CORRECTED USERS”
    Update-CsUserData -FileName $folderPath\Lync2013EditedUserData.zip -Confirm:$false -Verbose
    Write-Host -ForegroundColor Green “IMPORT COMPLETED SUCCESSFULLY"
    Write-Host -ForegroundColor YELLOW “STARTING POST-IMPORT-CLEANUP OF EXPORT/IMPORT FILES"
    If (Test-Path "$folderPath\Lync2013UserData.zip") { Remove-Item "$folderPath\Lync2013UserData.zip" }
    If (Test-Path "$folderPath\Lync2010UserData.xml") { Remove-Item "$folderPath\Lync2010UserData.xml" }
    If (Test-Path "$folderPath\Lync2010EditedUserData.xml") { Remove-Item "$folderPath\Lync2010EditedUserData.xml" }
    If (Test-Path "$folderPath\Lync2013EditedUserData.zip") { Remove-Item "$folderPath\Lync2013EditedUserData.zip" }
    Write-Host -ForegroundColor Green “POST-IMPORT-CLEANUP COMPLETED"
    #Message Out
    Write-Host -ForegroundColor Green “AD PHOTO SETTING SUCCESSFULLY UPDATED"

    When I try to run this I get the follow error.  Any thoughts?
    Update-CsUserData : Unable to cast COM object of type 'System.__ComObject' to interface type
    'Microsoft.Rtc.Interop.User.ICsUserManagement'. This operation failed because the QueryInterface call on
    the COM component for the interface with IID '{D5ADD966-BDC3-4A8F-BFE8-6A59A9F74CB2}' failed due to the
    following error: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
    At C:\Lync2013Scripts\ForceDisplayPhoto.ps1:113 char:1
    + Update-CsUserData -FileName $folderPath\Lync2013EditedUserData.zip -Confirm:$fal ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: ([email protected]:String) [Update-CsUserData], Invalid
       CastException
        + FullyQualifiedErrorId : Microsoft.Rtc.Management.AD.Cmdlets.ImportOcsUserDataCmdlet

Maybe you are looking for

  • Need to detect when an item is clicked in a combo box in flex 3

    Hello I am having a check box and a combo box whenever any selection is made in combo box (current selection may be same as previous selection), I need to select the check box. By default the 1st item in combo box is selected and check box is unselec

  • I cant find my photos

    I cant seem to get used to this Photo thing on iMac. I can see my photos are all on there but when for example I want to add one of those new photos to a website photos can't locate my recent photos. if you get me. So why is it accessible in Photos,

  • Photoshop CS5 | Slider on Video Frames to Layers Missing

    Hello! I recently got a new computer and have since reinstalled Photoshop. I like to my gifs and the such but when I went to select what frame I wanted I had this show up. I have never had this happen before, any help is greatly appreciated. miranda

  • I have a question that need to solve :)

    First of all I'm a HUGE fan of HP. I have a laptop, Name is Cortana and I will never leave her but I want to upgrade her. Her Cpu is Core 2 dual 2.1 and her socket name is Socket P, I want to upgrade her to intel® Core™2 Extreme Processor QX9300 (12M

  • Not wifi on sleep

    Upon transition to a dream mode the MacBook pro laptop disconnects wifi a network except eth And so each time tried to be connected a feather to a network too most OS ML 10.8 MacBook pro 2009