Results 1 to 3 of 3

Thread: Open jpg

  1. #1
    Sean2012 is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default Open jpg

    Hello I am trying to make a little thing for fathers day. I want to have java open a jpg file. I know to run a win32 file you use this Runtime.getRuntime().exec but how would I go about opening the jpg. I just want it to open in windows photoviewer. Thanks for any help!

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,513
    Blog Entries
    7
    Rep Power
    20

    Default Re: Open jpg

    The ImageIO and ImageIcon classes can be of help ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default Re: Open jpg

    Quote Originally Posted by Sean2012 View Post
    how would I go about opening the jpg. I just want it to open in windows photoviewer.
    Check out the API for java.awt.Desktop.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. How to open New page?
    By Ashi in forum New To Java
    Replies: 1
    Last Post: 01-14-2012, 01:12 PM
  2. I/O How to open a file
    By sehudson in forum New To Java
    Replies: 8
    Last Post: 07-18-2011, 03:32 AM
  3. Replies: 4
    Last Post: 02-07-2011, 08:43 AM
  4. Open JFrame
    By AndersBjörnör in forum AWT / Swing
    Replies: 2
    Last Post: 12-01-2009, 09:03 PM
  5. Different Files Open in File -> Open Workspace
    By mgm2010 in forum JCreator
    Replies: 0
    Last Post: 04-11-2009, 02:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •