No question- just a comment

Just got the Airport Extreme base station and wow......    can't believe how pleased I am.
I've had a router in the basement for years and could rarely get the Apple TV to work upstairs (ie, 2 hours to load a movie)
I also have an old Mac Pro Core 8 with no WiFi and bought the Airport box thing that looks like an apple tv.
For the first time ever, I've got a fast internet connection upstairs.
Not only that but all I could think as I was opening the well designed box, easy to unpack etc...was  "yeah Steve Jobs!!!" 
Finally somebody who knew how to get it right.
Congrats.    Hope Apple continues to always follow his example in the future now that he's passed. 

This is a user-to-user support forum so it isn't us that did anything to Pages. You can give feedback to Apple at https://www.apple.com/feedback/pages.html

Similar Messages

  • No question, just a comment. Why don't more people know about iMacs?

    Having put up with frustrating PC based computers for the past 16 years or so, I can't believe the beauty of a Mac.
    Simple, clean, easy to set up, everything just works, it doesn't need rebooting every 5 minutes...... These things are heaven sent!
    I will not be going back to the "dark side" any time soon....
    WoHoo, what a find, I can see why my mates rave about them so much.

    In the immortal words of the late and great Steve Jobs "It Just Works"

  • Not a question.  A comment actually.  Regarding the persistent blue Autofill popup in Safari.  My wife first shut down the Mac then unplugged it for a few minutes.  On restart, the box was gone.

    Not a question.  A comment actually.  Regarding the persistent blue autofill box that may appear in Safari, my wife shut down the iMac then unplugged it for a few minutes.  On restarting, the box was gone.

    Do you have a question?

  • Not rally a question, just wanted to share my absolute frustration with the update of iTunes...this is, without a shadow of a doubt THE WORST application i have EVER used, Mac or PC! And that's saying something with the amount of PC dross that's out there

    Not rally a question, just wanted to share my absolute frustration with the update of iTunes...this is, without a shadow of a doubt THE WORST application i have EVER used, Mac or PC! And that's saying something with the amount of PC dross that's out there...Apple...PLEASE update and give us back the old version of iTunes...

    Pull down View > Show Sidebar. This will give you back the same functionality of iTunes 10.x.x.

  • This is not a question just an observation. happy birthday ipod. thank you for the fantastic 10 years, thank you for changing the way we think about music.

    this is not a question just an observation. happy birthday ipod. thank you for the fantastic 10 years, thank you for changing the way we think about music.

    frank,
     every negative experience is an opportinity to learn.   deleting or moderating these experiences would be turning away the chance to learn.   as long as users follow the participation rules, we allow even the most negative posts to remain. 
    as you said, forums are inherently negative by nature as users typically come here to solve a problem.   those of us who try to solve the problems are in the minority.   we certainly appreciate users such as yourself who voluntarily return to the forum to help out, especially those who initially came here to solve a problem themselves.
    thank you as well.
    -erik
    ThinkStation C20
    ThinkPad X1C · X220 · X60T · s30 · 600

  • Je n'arrive plus a envoyé un msg avec Imessage.. On demande le mot de passe du Account «Null» pourquoi cette question et surtout comment faire pour que je retrouve mon ID?

    Je n'arrive plus a envoyé un msg avec Imessage.. On demande le mot de passe du Account «Null» pourquoi cette question et surtout comment faire pour qu'il pointe sur mon ID?

    Bonjour et merci ,
    Le probleme c'est l'utilisation dans l'argument de vente de ces outils non fonctionnels.
    Je te prends un autre exemple sur la page : http://www.adobe.com/fr/products/creativecloud/design.html?skwcid=true
    Si je comprends bien kuler fonctionne desormais en France ?
    Ou est ce simplement la traduction d'un argumentaire US/EN faux pour la France, et donc une publicité mensongère ?
    Tout ceci pour dire, quand je me suis abonné on m'a vendu un cloud de 20go, on ne m'a pas vendu un cloud non fonctionnel.
    Attention à ne pas vendre la peau de l'ours ...

  • No question, just a remark to say how upset I am that Apple still does not have flash player on iPad or iPod touch. Still upset not to be able to view my family's video on my iPad! Upset customer!

    No question, just a remark to say how upset I am that Apple still does not have flash player on iPad or iPod touch. Still upset not to be able to view my family's video on my iPad! Upset customer!

    This is a user to user forum, and Apple does not follow these discussions. But here is what Apple says about not having Flashplayer on iDevices:
    Thoughts on Flash
    You can tell Apple your thoughts directly by using this link:
    Apple - iPad - Feedback
    You can watch your videos on your iPad by syncing them via iTunes:
    iTunes: Frequently asked questions about viewing and syncing videos
    Message was edited by: Ingo2711

  • Just a comment/question on OS upgrades (VZW/Sprint).

    First, the question:
    I upgraded the 8330 Curve OS to 4.5 on a friend's device (VZW).  No problem, everything seems to work as near as he can tell, but for some reason it is very laggy...I searched and couldn't find a specific answer to the question.
    What he reported as laggy was opening pics in the phone.  I then learned that his device did not come with a micro SD, and he has saved all of his pictures to the device memory.  How would the new OS affect this, when he had no problems or issues with this on the old OS?  I suggested he purchase an 8g micro sd hc, and get all of that garbage off of the internal memory. 
    Also, I did not see the "docs to go" app anywhere, wondered if that was supposed to be an icon or an application - either way it isn't there.
    Now, the comment:
    On this and several other sites, I've seen the virtual frothing at the mouth for everyone that wants to upgrade to the "latest and greatest" OS.  (Which by the way, I am crediting to the election of Barack Obama.) I have learned a lot through research, and I understand that each vendor puts out the version when they finish testing, etc...
    I also understand that people will delete vendor xml's to load another carrier's 4.5, but now I see that they have released like .89 already, when everyone was so crazy to get .77 (which appears to even have some issues). 
    Isn't there a better way?
    As a regular, non-tekkie kind of guy, I get awful confused when RIM says they've released 4.5, only to be frustrated for 12 hours with my Sprint device trying to upload it because it hasn't yet been released by Sprint.  Does it support MMS, does it not support MMS? Who do I find out officially from whether it supports MMS?  It seems as though all of these instructions breed nothing but more questions and problems.  When non-tekkies look for answers, they want to simply click a button - update complete, works great.  Not the case with the new OS frenzy, and it seems every site has a different answer, different supposition, and repeatedly has to create new threads because people can't seem to find the "SEARCH" feature.
    I appreciate truly, all of the help I've received here just for a few minor issues that I've had, but doesn't providing "instructional material" for us nontechnical morons, just an exercise in creating another "HELP, I'VE NUKED MY BERRY" thread?
    Okay, deep breaths.
    [/rant]
    On another note, I've had BB's since my clunky NEXTEL 75xx series. Then an 8703e. I never knew the capability of the device until I immersed myself in it.  I've converted my best buddy (pocket POS user for years), my wife (pocket POS owner and loather), my sis and brother in law - all to 8330's and all have repeated resoundingly the comment that I have made for years:  A BB will change your life.
    And I can't believe how many co-workers of my wife (an RN) who have bought BB's and absolutely HATE them, until she shows them (thru messenger to me on how to fix or use something) just what they can do.
    I sure hope I haven't wasted anyone's time with this post, and hope I'm not violating some term of service for ranting like a nut.  Just had to get that off my chest.
    Have a great day.

    do you feel better ? Sometimes rantings as you called it, make one feel better!
    hope you are enjoying your blackberry
    Nurse-Berry
    Follow NurseBerry08 on Twitter

  • No question here, , just  a comment I verigzon sucks,  I had an aircard and didn't work, not the first one either.  they have 3 years of

    this site even sucks,  I have had a running battle with verizon for four years.  I had an air card that kept going from 1x 2g 3g 4g and back.  they told me that i was in a switching station and my issue.  I told them my house doesnt move.  then after putting up with this and haveing to wait to send my invoiecdes to my customers when it happened to work was unacceptable.  we finnalyhad to say goodbye.  O boy that didn't settle well.  they have put me through the ringer.  To the point that just today I got it straightened out.  I think.  they suspended my service and then sent me a bill for 73 bucks.  they tried to charge me 350.00 for terminating and I have been a customer for over ten years.  they charge me little fees on my bill every couple of months.  Its incredible.  If i ran my business liike this I would be out of business in a month.  I stuck till 2015 then I'm gone, somebody has to have better service.  fyi I pay 210 bucks per month, I'm not a small customer.  I have many more comments but this is getting long, will give more details later

    markchackett
    Well, that was pointless. You didn't specify anything that happened, and I'm not quite sure who you expected to see this. This is mainly a customer-to-customer support forum. Verizon does respond, but it's debatable whether they would reply here.
    Also, the ETF applies to everyone. You signed a contract with them agreeing to the ETF. It doesn't matter whether you've been a customer for 10 years or just started last month, a contract is a contract.

  • Just a comment / question

    Since Apple managed to do the difficult thing (producing a very light laptop) why didn't they give it a smaller screen to make it compact and even lighter?
    An 11 or 12inch screen would be far more appropriate I think.
    Just a thought...

    CHRIS CHADJIDAKIS wrote:
    Since Apple managed to do the difficult thing (producing a very light laptop) why didn't they give it a smaller screen to make it compact and even lighter?
    An 11 or 12inch screen would be far more appropriate I think.
    Just a thought...
    There selling point was the full sized keyboard and screen according to the keynote plus various interviews done.

  • Updated : No question, just example web cam capture code

    Hi,
    I posted this example a while back, but it had some cosmetic bugs in it.
    Here's an updated version.
    Quick Start
    1. Install JMF 2.1.1e (performance pack version)
    ( see imports list in source code if you really want to run it using the older version 2.1.1c )
    2. You have to set the JMF_HOME or JMFHOME environment variable. Can't remember which one.
    "Nearly sure" it's JMF_HOME.
    3. Connect your camera
    4. run jmfinit ( may need to do a few times until it detects your camera )
    When it does, you're in business, and you can try to run the code
    5. Run java -cp .;%JMF_HOME%\lib\jmf.jar JWebCam
    known issue
    Under Java 1.5 / 5 - When capturing a frame, and then resizing that snapshots JFrame, the image did not always scale up and display.
    That does work under Java 1.3.1_06 .
    Tested on Win98 2nd edition, Java 1.3.1_06, and Creative Web Cam Pro.
    Legal stuff in plain english : This code is available for use by everyone, personal or commercial, no need to mention me in licenses or anything. It's just a demo I knocked up for myself. So I am under no obligation to support this. Use it at your own risk.... that implies you can't blame or sue me for anything that goes wrong.
    If you like the code, I'd be happy to hear whereabouts you are in the world :-)
    Also note : this is the limits of my JMF experience at present.
    If you've a separate question, post it to a new topic!
    regards,
    Owen ( Dublin, Ireland )
    import javax.swing.*;
    import javax.swing.border.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.datasink.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    // import com.sun.media.vfw.VFWCapture;         // JMF 2.1.1c version
    import com.sun.media.protocol.vfw.VFWCapture;   // JMF 2.1.1e version
    public class JWebCam extends JFrame
        implements WindowListener,  ComponentListener
        protected final static int MIN_WIDTH  = 100;  // 320;
        protected final static int MIN_HEIGHT = 100;  // 240;
        protected static int shotCounter = 1;
        protected JLabel statusBar = null;
        protected JPanel visualContainer = null;
        protected Component visualComponent = null;
        protected JToolBar toolbar = null;
        protected MyToolBarAction formatButton    = null;
        protected MyToolBarAction captureButton   = null;
        protected Player player = null;
        protected CaptureDeviceInfo webCamDeviceInfo = null;
        protected MediaLocator ml = null;
        protected Dimension imageSize = null;
        protected FormatControl formatControl = null;
        protected VideoFormat currentFormat = null;
        protected Format[] videoFormats = null;
        protected MyVideoFormat[] myFormatList = null;
        protected MyCaptureDeviceInfo[] myCaptureDevices = null;
        protected boolean initialised = false;
         * Constructor
        public JWebCam ( String frameTitle )
            super ( frameTitle );
            try
                UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
            catch ( Exception cnfe )
                System.out.println ("Note : Cannot load look and feel settings");
            setSize ( 320, 260 ); // default size...
            addWindowListener ( this );
            addComponentListener ( this );
            getContentPane().setLayout ( new BorderLayout() );
            visualContainer = new JPanel();
            visualContainer.setLayout ( new BorderLayout() );
            getContentPane().add ( visualContainer, BorderLayout.CENTER );
            statusBar = new JLabel ("")
                // Nasty bug workaround
                // The minimum JLabel size was determined by the text in the status bar
                // So the layoutmanager wouldn't shrink the window for the video image
                public Dimension getPreferredSize (  )
                    // get the JLabel to "allow" a minimum of 10 pixels width
                    // not to work out the minimum size from the text length
                    return ( new Dimension ( 10, super.getPreferredSize().height ) );
            statusBar.setBorder ( new EtchedBorder() );
            getContentPane().add ( statusBar, BorderLayout.SOUTH );
         * Initialise
         * @returns true if web cam is detected
        public boolean initialise ( )
            throws Exception
            MyCaptureDeviceInfo[] cams = autoDetect();
            if ( cams.length > 0 )
                if ( cams.length == 1 )
                     System.out.println ("Note : 1 web cam detected");
                     return ( initialise ( cams[0].capDevInfo ) );
                else
                    System.out.println ("Note : " + cams.length + " web cams detected");
                    Object selected = JOptionPane.showInputDialog (this,
                                                                   "Select Video format",
                                                                   "Capture format selection",
                                                                   JOptionPane.INFORMATION_MESSAGE,
                                                                   null,        //  Icon icon,
                                                                   cams, // videoFormats,
                                                                   cams[0] );
                    if ( selected != null )
                        return ( initialise ( ((MyCaptureDeviceInfo)selected).capDevInfo ) );
                    else
                        return ( initialise ( null ) );
            else
                return ( initialise ( null ) );
         * Initialise
         * @params _deviceInfo, specific web cam device if not autodetected
         * @returns true if web cam is detected
        public boolean initialise ( CaptureDeviceInfo _deviceInfo )
            throws Exception
            statusBar.setText ( "Initialising...");
            webCamDeviceInfo = _deviceInfo;
            if ( webCamDeviceInfo != null )
                statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                try
                    setUpToolBar();
                    getContentPane().add ( toolbar, BorderLayout.NORTH );
                    ml = webCamDeviceInfo.getLocator();
                    if ( ml != null )
                        player = Manager.createRealizedPlayer ( ml );
                        if ( player != null )
                            player.start();
                            formatControl = (FormatControl)player.getControl ( "javax.media.control.FormatControl" );
                            videoFormats = webCamDeviceInfo.getFormats();
                            myFormatList = new MyVideoFormat[videoFormats.length];
                            for ( int i=0; i<videoFormats.length; i++ )
                                myFormatList[i] = new MyVideoFormat ( (VideoFormat)videoFormats[i] );
                            Format currFormat = formatControl.getFormat();
                            visualComponent = player.getVisualComponent();
                            if ( visualComponent != null )
                                visualContainer.add ( visualComponent, BorderLayout.CENTER );
                                if ( currFormat instanceof VideoFormat )
                                     currentFormat = (VideoFormat)currFormat;
                                     imageSize = currentFormat.getSize();
                                     visualContainer.setPreferredSize ( imageSize );
                                     setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
                                else
                                    System.err.println ("Error : Cannot get current video format");
                                invalidate();
                                pack();
                                return ( true );
                            else
                                System.err.println ("Error : Could not get visual component");
                                return ( false );
                        else
                            System.err.println ("Error : Cannot create player");
                            statusBar.setText ( "Cannot create player" );
                            return ( false );
                    else
                        System.err.println ("Error : No MediaLocator for " + webCamDeviceInfo.getName() );
                        statusBar.setText ( "No Media Locator for : " + webCamDeviceInfo.getName() );
                        return ( false );
                catch ( IOException ioEx )
                    System.err.println ("Error connecting to [" + webCamDeviceInfo.getName() + "] : " + ioEx.getMessage() );
                    statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                    return ( false );
                catch ( NoPlayerException npex )
                    statusBar.setText ("Cannot create player");
                    return ( false );
                catch ( CannotRealizeException nre )
                    statusBar.setText ( "Cannot realize player");
                    return ( false );
            else
                return ( false );
         * Dynamically create menu items
         * @returns the device info object if found, null otherwise
        public void setFormat ( VideoFormat selectedFormat )
            if ( formatControl != null )
                // player.stop();       // not needed and big performance hit
                currentFormat = selectedFormat;
                if ( visualComponent != null )
                     visualContainer.remove ( visualComponent );
                imageSize = currentFormat.getSize();
                visualContainer.setPreferredSize ( imageSize );
                statusBar.setText ( "Format : " + currentFormat );
                System.out.println ("Format : " + currentFormat );
                formatControl.setFormat ( currentFormat );
                // player.start();  // not needed and big performance hit
                visualComponent = player.getVisualComponent();
                if ( visualComponent != null )
                    visualContainer.add ( visualComponent, BorderLayout.CENTER );
                invalidate();       // let the layout manager work out the sizes
                pack();
            else
                System.out.println ("Visual component not an instance of FormatControl");
                statusBar.setText ( "Visual component cannot change format" );
        public VideoFormat getFormat ( )
            return ( currentFormat );
        protected void setUpToolBar ( )
            toolbar = new JToolBar();
            // Note : due to cosmetic glitches when undocking and docking the toolbar,
            //        I've set this to false.
            toolbar.setFloatable(false);
            // Note : If you supply the 16 x 16 bitmaps then you can replace
            // the commented line in the MyToolBarAction constructor
            formatButton    = new MyToolBarAction ( "Resolution", "BtnFormat.jpg" );
            captureButton   = new MyToolBarAction ( "Capture",    "BtnCapture.jpg" );
            toolbar.add ( formatButton );
            toolbar.add ( captureButton );
            getContentPane().add ( toolbar, BorderLayout.NORTH );
        protected void toolbarHandler ( MyToolBarAction actionBtn )
            if ( actionBtn == formatButton )
                Object selected = JOptionPane.showInputDialog (this,
                                                               "Select Video format",
                                                               "Capture format selection",
                                                               JOptionPane.INFORMATION_MESSAGE,
                                                               null,        //  Icon icon,
                                                               myFormatList, // videoFormats,
                                                               currentFormat );
                if ( selected != null )
                    setFormat ( ((MyVideoFormat)selected).format );
            else if ( actionBtn == captureButton )
                Image photo = grabFrameImage ( );
                if ( photo != null )
                    MySnapshot snapshot = new MySnapshot ( photo, new Dimension ( imageSize ) );
                else
                    System.err.println ("Error : Could not grab frame");
         * autoDetects the first web camera in the system
         * searches for video for windows ( vfw ) capture devices
         * @returns the device info object if found, null otherwise
        public MyCaptureDeviceInfo[] autoDetect ( )
            Vector list = CaptureDeviceManager.getDeviceList ( null );
            CaptureDeviceInfo devInfo = null;
            String name;
            Vector capDevices = new Vector();
            if ( list != null )
                for ( int i=0; i<list.size(); i++ )
                    devInfo = (CaptureDeviceInfo)list.elementAt ( i );
                    name = devInfo.getName();
                    if ( name.startsWith ("vfw:") )
                        System.out.println ("DeviceManager List : " + name );
                        capDevices.addElement ( new MyCaptureDeviceInfo ( devInfo ) );
            else
                for ( int i = 0; i < 10; i++ )
                    try
                        name = VFWCapture.capGetDriverDescriptionName ( i );
                        if (name != null && name.length() > 1)
                            devInfo = com.sun.media.protocol.vfw.VFWSourceStream.autoDetect ( i );
                            if ( devInfo != null )
                                System.out.println ("VFW Autodetect List : " + name );
                                capDevices.addElement ( new MyCaptureDeviceInfo ( devInfo ) );
                    catch ( Exception ioEx )
                        System.err.println ("Error connecting to [" + webCamDeviceInfo.getName() + "] : " + ioEx.getMessage() );
                        // ignore errors detecting device
                        statusBar.setText ( "AutoDetect failed : " + ioEx.getMessage() );
            MyCaptureDeviceInfo[] detected = new MyCaptureDeviceInfo[ capDevices.size() ];
            for ( int i=0; i<capDevices.size(); i++ )
                detected[i] = (MyCaptureDeviceInfo)capDevices.elementAt ( i );
            return ( detected );
         * deviceInfo
         * @note outputs text information
        public void deviceInfo ( )
            if ( webCamDeviceInfo != null )
                Format[] formats = webCamDeviceInfo.getFormats();
                if ( ( formats != null ) && ( formats.length > 0 ) )
                for ( int i=0; i<formats.length; i++ )
                    Format aFormat = formats;
    if ( aFormat instanceof VideoFormat )
    Dimension dim = ((VideoFormat)aFormat).getSize();
    // System.out.println ("Video Format " + i + " : " + formats[i].getEncoding() + ", " + dim.width + " x " + dim.height );
    else
    System.out.println ("Error : No web cam detected");
    * grabs a frame's buffer from the web cam / device
    * @returns A frames buffer
    public Buffer grabFrameBuffer ( )
    if ( player != null )
    FrameGrabbingControl fgc = (FrameGrabbingControl)player.getControl ( "javax.media.control.FrameGrabbingControl" );
    if ( fgc != null )
    return ( fgc.grabFrame() );
    else
    System.err.println ("Error : FrameGrabbingControl is null");
    return ( null );
    else
    System.err.println ("Error : Player is null");
    return ( null );
    * grabs a frame's buffer, as an image, from the web cam / device
    * @returns A frames buffer as an image
    public Image grabFrameImage ( )
    Buffer buffer = grabFrameBuffer();
    if ( buffer != null )
    // Convert it to an image
    BufferToImage btoi = new BufferToImage ( (VideoFormat)buffer.getFormat() );
    if ( btoi != null )
    Image image = btoi.createImage ( buffer );
    if ( image != null )
    return ( image );
    else
    System.err.println ("Error : BufferToImage cannot convert buffer");
    return ( null );
    else
    System.err.println ("Error : cannot create BufferToImage instance");
    return ( null );
    else
    System.out.println ("Error : Buffer grabbed is null");
    return ( null );
    * Closes and cleans up the player
    public void playerClose ( )
    if ( player != null )
    player.close();
    player.deallocate();
    player = null;
    public void windowClosing ( WindowEvent e )
    playerClose();
    System.exit ( 1 );
    public void componentResized ( ComponentEvent e )
    Dimension dim = getSize();
    boolean mustResize = false;
    if ( dim.width < MIN_WIDTH )
    dim.width = MIN_WIDTH;
    mustResize = true;
    if ( dim.height < MIN_HEIGHT )
    dim.height = MIN_HEIGHT;
    mustResize = true;
    if ( mustResize )
    setSize ( dim );
    public void windowActivated ( WindowEvent e ) {   }
    public void windowClosed ( WindowEvent e ) {   }
    public void windowDeactivated ( WindowEvent e ) {   }
    public void windowDeiconified ( WindowEvent e ) {   }
    public void windowIconified ( WindowEvent e ) {   }
    public void windowOpened ( WindowEvent e ) {   }
    public void componentHidden(ComponentEvent e) {   }
    public void componentMoved(ComponentEvent e) {   }
    public void componentShown(ComponentEvent e) {   }
    protected void finalize ( ) throws Throwable
    playerClose();
    super.finalize();
    class MyToolBarAction extends AbstractAction
    public MyToolBarAction ( String name, String imagefile )
    // Note : Use version this if you supply your own toolbar icons
    // super ( name, new ImageIcon ( imagefile ) );
    super ( name );
    public void actionPerformed ( ActionEvent event )
    toolbarHandler ( this );
    class MyVideoFormat
    public VideoFormat format;
    public MyVideoFormat ( VideoFormat format )
    this.format = format;
    public String toString ( )
    Dimension dim = format.getSize();
    return ( format.getEncoding() + " [ " + dim.width + " x " + dim.height + " ]" );
    class MyCaptureDeviceInfo
    public CaptureDeviceInfo capDevInfo;
    public MyCaptureDeviceInfo ( CaptureDeviceInfo devInfo )
    capDevInfo = devInfo;
    public String toString ( )
    return ( capDevInfo.getName() );
    class MySnapshot extends JFrame implements ImageObserver
    protected Image photo = null;
    protected int shotNumber;
    public MySnapshot ( Image grabbedFrame, Dimension imageSize )
    super ( );
    shotNumber = shotCounter++;
    setTitle ( "Photo" + shotNumber );
    photo = grabbedFrame;
    setDefaultCloseOperation ( WindowConstants.DISPOSE_ON_CLOSE );
    int imageHeight = photo.getWidth ( this );
    int imageWidth = photo.getHeight ( this );
    setSize ( imageSize.width, imageSize.height );
    final FileDialog saveDialog = new FileDialog ( this, "Save JPEG", FileDialog.SAVE );
    final JFrame thisCopy = this;
    saveDialog.setFile ( "Photo" + shotNumber );
    addWindowListener ( new WindowAdapter()
    public void windowClosing ( WindowEvent e )
    saveDialog.show();
    String filename = saveDialog.getFile();
    if ( filename != null )
    if ( saveJPEG ( filename ) )
    JOptionPane.showMessageDialog ( thisCopy, "Saved " + filename );
    setVisible ( false );
    dispose();
    else
    JOptionPane.showMessageDialog ( thisCopy, "Error saving " + filename );
    else
    setVisible ( false );
    dispose();
    setVisible ( true );
    public void paint ( Graphics g )
    super.paint ( g );
    g.drawImage ( photo, 0, 0, getWidth(), getHeight(), Color.black, this );
    * Saves an image as a JPEG
    * @params the image to save
    * @params the filename to save the image as
    public boolean saveJPEG ( String filename )
    boolean saved = false;
    BufferedImage bi = new BufferedImage ( photo.getWidth(null),
    photo.getHeight(null),
    BufferedImage.TYPE_INT_RGB );
    Graphics2D g2 = bi.createGraphics();
    g2.drawImage ( photo, null, null );
    FileOutputStream out = null;
    try
    out = new FileOutputStream ( filename );
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder ( out );
    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam ( bi );
    param.setQuality ( 1.0f, false ); // 100% high quality setting, no compression
    encoder.setJPEGEncodeParam ( param );
    encoder.encode ( bi );
    out.close();
    saved = true;
    catch ( Exception ex )
    System.out.println ("Error saving JPEG : " + ex.getMessage() );
    return ( saved );
    } // of MySnapshot
    public static void main (String[] args )
    try
    JWebCam myWebCam = new JWebCam ( "Web Cam Capture" );
    myWebCam.setVisible ( true );
    if ( !myWebCam.initialise() )
    System.out.println ("Web Cam not detected / initialised");
    catch ( Exception ex )
    ex.printStackTrace();

    Hi,
    Here's a working version.
    If there are no spaces after the "<" symbol, it thinks it's a HTML tag.
    Putting spaces in, stops this.
    cheers,
    Owen
    import javax.swing.*;
    import javax.swing.border.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.datasink.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    // import com.sun.media.vfw.VFWCapture;         // JMF 2.1.1c version
    import com.sun.media.protocol.vfw.VFWCapture;   // JMF 2.1.1e version
    public class JWebCam extends JFrame
        implements WindowListener,  ComponentListener
        protected final static int MIN_WIDTH  = 100;  // 320;
        protected final static int MIN_HEIGHT = 100;  // 240;
        protected static int shotCounter = 1;
        protected JLabel statusBar = null;
        protected JPanel visualContainer = null;
        protected Component visualComponent = null;
        protected JToolBar toolbar = null;
        protected MyToolBarAction formatButton    = null;
        protected MyToolBarAction captureButton   = null;
        protected Player player = null;
        protected CaptureDeviceInfo webCamDeviceInfo = null;
        protected MediaLocator ml = null;
        protected Dimension imageSize = null;
        protected FormatControl formatControl = null;
        protected VideoFormat currentFormat = null;
        protected Format[] videoFormats = null;
        protected MyVideoFormat[] myFormatList = null;
        protected MyCaptureDeviceInfo[] myCaptureDevices = null;
        protected boolean initialised = false;
         * Constructor
        public JWebCam ( String frameTitle )
            super ( frameTitle );
            try
                UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
            catch ( Exception cnfe )
                System.out.println ("Note : Cannot load look and feel settings");
            setSize ( 320, 260 ); // default size...
            addWindowListener ( this );
            addComponentListener ( this );
            getContentPane().setLayout ( new BorderLayout() );
            visualContainer = new JPanel();
            visualContainer.setLayout ( new BorderLayout() );
            getContentPane().add ( visualContainer, BorderLayout.CENTER );
            statusBar = new JLabel ("")
                // Nasty bug workaround
                // The minimum JLabel size was determined by the text in the status bar
                // So the layoutmanager wouldn't shrink the window for the video image
                public Dimension getPreferredSize (  )
                    // get the JLabel to "allow" a minimum of 10 pixels width
                    // not to work out the minimum size from the text length
                    return ( new Dimension ( 10, super.getPreferredSize().height ) );
            statusBar.setBorder ( new EtchedBorder() );
            getContentPane().add ( statusBar, BorderLayout.SOUTH );
         * Initialise
         * @returns true if web cam is detected
        public boolean initialise ( )
            throws Exception
            MyCaptureDeviceInfo[] cams = autoDetect();
            if ( cams.length > 0 )
                if ( cams.length == 1 )
                     System.out.println ("Note : 1 web cam detected");
                     return ( initialise ( cams[0].capDevInfo ) );
                else
                    System.out.println ("Note : " + cams.length + " web cams detected");
                    Object selected = JOptionPane.showInputDialog (this,
                                                                   "Select Video format",
                                                                   "Capture format selection",
                                                                   JOptionPane.INFORMATION_MESSAGE,
                                                                   null,        //  Icon icon,
                                                                   cams, // videoFormats,
                                                                   cams[0] );
                    if ( selected != null )
                        return ( initialise ( ((MyCaptureDeviceInfo)selected).capDevInfo ) );
                    else
                        return ( initialise ( null ) );
            else
                return ( initialise ( null ) );
         * Initialise
         * @params _deviceInfo, specific web cam device if not autodetected
         * @returns true if web cam is detected
        public boolean initialise ( CaptureDeviceInfo _deviceInfo )
            throws Exception
            statusBar.setText ( "Initialising...");
            webCamDeviceInfo = _deviceInfo;
            if ( webCamDeviceInfo != null )
                statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                try
                    setUpToolBar();
                    getContentPane().add ( toolbar, BorderLayout.NORTH );
                    ml = webCamDeviceInfo.getLocator();
                    if ( ml != null )
                        player = Manager.createRealizedPlayer ( ml );
                        if ( player != null )
                            player.start();
                            formatControl = (FormatControl)player.getControl ( "javax.media.control.FormatControl" );
                            videoFormats = webCamDeviceInfo.getFormats();
                            myFormatList = new MyVideoFormat[videoFormats.length];
                            for ( int i=0; i < videoFormats.length; i++ )
                                myFormatList[i] = new MyVideoFormat ( (VideoFormat)videoFormats[i] );
                            Format currFormat = formatControl.getFormat();
                            visualComponent = player.getVisualComponent();
                            if ( visualComponent != null )
                                visualContainer.add ( visualComponent, BorderLayout.CENTER );
                                if ( currFormat instanceof VideoFormat )
                                     currentFormat = (VideoFormat)currFormat;
                                     imageSize = currentFormat.getSize();
                                     visualContainer.setPreferredSize ( imageSize );
                                     setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
                                else
                                    System.err.println ("Error : Cannot get current video format");
                                invalidate();
                                pack();
                                return ( true );
                            else
                                System.err.println ("Error : Could not get visual component");
                                return ( false );
                        else
                            System.err.println ("Error : Cannot create player");
                            statusBar.setText ( "Cannot create player" );
                            return ( false );
                    else
                        System.err.println ("Error : No MediaLocator for " + webCamDeviceInfo.getName() );
                        statusBar.setText ( "No Media Locator for : " + webCamDeviceInfo.getName() );
                        return ( false );
                catch ( IOException ioEx )
                    System.err.println ("Error connecting to [" + webCamDeviceInfo.getName() + "] : " + ioEx.getMessage() );
                    statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                    return ( false );
                catch ( NoPlayerException npex )
                    statusBar.setText ("Cannot create player");
                    return ( false );
                catch ( CannotRealizeException nre )
                    statusBar.setText ( "Cannot realize player");
                    return ( false );
            else
                return ( false );
         * Dynamically create menu items
         * @returns the device info object if found, null otherwise
        public void setFormat ( VideoFormat selectedFormat )
            if ( formatControl != null )
                player.stop();
                currentFormat = selectedFormat;
                if ( visualComponent != null )
                     visualContainer.remove ( visualComponent );
                imageSize = currentFormat.getSize();
                visualContainer.setPreferredSize ( imageSize );
                statusBar.setText ( "Format : " + currentFormat );
                System.out.println ("Format : " + currentFormat );
                formatControl.setFormat ( currentFormat );
                player.start();
                visualComponent = player.getVisualComponent();
                if ( visualComponent != null )
                    visualContainer.add ( visualComponent, BorderLayout.CENTER );
                invalidate();       // let the layout manager work out the sizes
                pack();
            else
                System.out.println ("Visual component not an instance of FormatControl");
                statusBar.setText ( "Visual component cannot change format" );
        public VideoFormat getFormat ( )
            return ( currentFormat );
        protected void setUpToolBar ( )
            toolbar = new JToolBar();
            // Note : due to cosmetic glitches when undocking and docking the toolbar,
            //        I've set this to false.
            toolbar.setFloatable(false);
            // Note : If you supply the 16 x 16 bitmaps then you can replace
            // the commented line in the MyToolBarAction constructor
            formatButton    = new MyToolBarAction ( "Resolution", "BtnFormat.jpg" );
            captureButton   = new MyToolBarAction ( "Capture",    "BtnCapture.jpg" );
            toolbar.add ( formatButton );
            toolbar.add ( captureButton );
            getContentPane().add ( toolbar, BorderLayout.NORTH );
        protected void toolbarHandler ( MyToolBarAction actionBtn )
            if ( actionBtn == formatButton )
                Object selected = JOptionPane.showInputDialog (this,
                                                               "Select Video format",
                                                               "Capture format selection",
                                                               JOptionPane.INFORMATION_MESSAGE,
                                                               null,        //  Icon icon,
                                                               myFormatList, // videoFormats,
                                                               currentFormat );
                if ( selected != null )
                    setFormat ( ((MyVideoFormat)selected).format );
            else if ( actionBtn == captureButton )
                Image photo = grabFrameImage ( );
                if ( photo != null )
                    MySnapshot snapshot = new MySnapshot ( photo, new Dimension ( imageSize ) );
                else
                    System.err.println ("Error : Could not grab frame");
         * autoDetects the first web camera in the system
         * searches for video for windows ( vfw ) capture devices
         * @returns the device info object if found, null otherwise
        public MyCaptureDeviceInfo[] autoDetect ( )
            Vector list = CaptureDeviceManager.getDeviceList ( null );
            CaptureDeviceInfo devInfo = null;
            String name;
            Vector capDevices = new Vector();
            if ( list != null )
                for ( int i=0; i < list.size(); i++ )
                    devInfo = (CaptureDeviceInfo)list.elementAt ( i );
                    name = devInfo.getName();
                    if ( name.startsWith ("vfw:") )
                        System.out.println ("DeviceManager List : " + name );
                        capDevices.addElement ( new MyCaptureDeviceInfo ( devInfo ) );
            else
                for ( int i = 0; i < 10; i++ )
                    try
                        name = VFWCapture.capGetDriverDescriptionName ( i );
                        if (name != null && name.length() > 1)
                            devInfo = com.sun.media.protocol.vfw.VFWSourceStream.autoDetect ( i );
                            if ( devInfo != null )
                                System.out.println ("VFW Autodetect List : " + name );
                                capDevices.addElement ( new MyCaptureDeviceInfo ( devInfo ) );
                    catch ( Exception ioEx )
                        System.err.println ("Error connecting to [" + webCamDeviceInfo.getName() + "] : " + ioEx.getMessage() );
                        // ignore errors detecting device
                        statusBar.setText ( "AutoDetect failed : " + ioEx.getMessage() );
            MyCaptureDeviceInfo[] detected = new MyCaptureDeviceInfo[ capDevices.size() ];
            for ( int i=0; i < capDevices.size(); i++ )
                detected[i] = (MyCaptureDeviceInfo)capDevices.elementAt ( i );
            return ( detected );
         * deviceInfo
         * @note outputs text information
        public void deviceInfo ( )
            if ( webCamDeviceInfo != null )
                Format[] formats = webCamDeviceInfo.getFormats();
                if ( ( formats != null ) && ( formats.length > 0 ) )
                for ( int i=0; i < formats.length; i++ )
                    Format aFormat = formats;
    if ( aFormat instanceof VideoFormat )
    Dimension dim = ((VideoFormat)aFormat).getSize();
    // System.out.println ("Video Format " + i + " : " + formats[i].getEncoding() + ", " + dim.width + " x " + dim.height );
    else
    System.out.println ("Error : No web cam detected");
    * grabs a frame's buffer from the web cam / device
    * @returns A frames buffer
    public Buffer grabFrameBuffer ( )
    if ( player != null )
    FrameGrabbingControl fgc = (FrameGrabbingControl)player.getControl ( "javax.media.control.FrameGrabbingControl" );
    if ( fgc != null )
    return ( fgc.grabFrame() );
    else
    System.err.println ("Error : FrameGrabbingControl is null");
    return ( null );
    else
    System.err.println ("Error : Player is null");
    return ( null );
    * grabs a frame's buffer, as an image, from the web cam / device
    * @returns A frames buffer as an image
    public Image grabFrameImage ( )
    Buffer buffer = grabFrameBuffer();
    if ( buffer != null )
    // Convert it to an image
    BufferToImage btoi = new BufferToImage ( (VideoFormat)buffer.getFormat() );
    if ( btoi != null )
    Image image = btoi.createImage ( buffer );
    if ( image != null )
    return ( image );
    else
    System.err.println ("Error : BufferToImage cannot convert buffer");
    return ( null );
    else
    System.err.println ("Error : cannot create BufferToImage instance");
    return ( null );
    else
    System.out.println ("Error : Buffer grabbed is null");
    return ( null );
    * Closes and cleans up the player
    public void playerClose ( )
    if ( player != null )
    player.close();
    player.deallocate();
    player = null;
    public void windowClosing ( WindowEvent e )
    playerClose();
    System.exit ( 1 );
    public void componentResized ( ComponentEvent e )
    Dimension dim = getSize();
    boolean mustResize = false;
    if ( dim.width < MIN_WIDTH )
    dim.width = MIN_WIDTH;
    mustResize = true;
    if ( dim.height < MIN_HEIGHT )
    dim.height = MIN_HEIGHT;
    mustResize = true;
    if ( mustResize )
    setSize ( dim );
    public void windowActivated ( WindowEvent e ) {   }
    public void windowClosed ( WindowEvent e ) {   }
    public void windowDeactivated ( WindowEvent e ) {   }
    public void windowDeiconified ( WindowEvent e ) {   }
    public void windowIconified ( WindowEvent e ) {   }
    public void windowOpened ( WindowEvent e ) {   }
    public void componentHidden(ComponentEvent e) {   }
    public void componentMoved(ComponentEvent e) {   }
    public void componentShown(ComponentEvent e) {   }
    protected void finalize ( ) throws Throwable
    playerClose();
    super.finalize();
    class MyToolBarAction extends AbstractAction
    public MyToolBarAction ( String name, String imagefile )
    // Note : Use version this if you supply your own toolbar icons
    // super ( name, new ImageIcon ( imagefile ) );
    super ( name );
    public void actionPerformed ( ActionEvent event )
    toolbarHandler ( this );
    class MyVideoFormat
    public VideoFormat format;
    public MyVideoFormat ( VideoFormat format )
    this.format = format;
    public String toString ( )
    Dimension dim = format.getSize();
    return ( format.getEncoding() + " [ " + dim.width + " x " + dim.height + " ]" );
    class MyCaptureDeviceInfo
    public CaptureDeviceInfo capDevInfo;
    public MyCaptureDeviceInfo ( CaptureDeviceInfo devInfo )
    capDevInfo = devInfo;
    public String toString ( )
    return ( capDevInfo.getName() );
    class MySnapshot extends JFrame implements ImageObserver
    protected Image photo = null;
    protected int shotNumber;
    public MySnapshot ( Image grabbedFrame, Dimension imageSize )
    super ( );
    shotNumber = shotCounter++;
    setTitle ( "Photo" + shotNumber );
    photo = grabbedFrame;
    setDefaultCloseOperation ( WindowConstants.DISPOSE_ON_CLOSE );
    int imageHeight = photo.getWidth ( this );
    int imageWidth = photo.getHeight ( this );
    setSize ( imageSize.width, imageSize.height );
    final FileDialog saveDialog = new FileDialog ( this, "Save JPEG", FileDialog.SAVE );
    final JFrame thisCopy = this;
    saveDialog.setFile ( "Photo" + shotNumber );
    addWindowListener ( new WindowAdapter()
    public void windowClosing ( WindowEvent e )
    saveDialog.show();
    String filename = saveDialog.getFile();
    if ( filename != null )
    if ( saveJPEG ( filename ) )
    JOptionPane.showMessageDialog ( thisCopy, "Saved " + filename );
    setVisible ( false );
    dispose();
    else
    JOptionPane.showMessageDialog ( thisCopy, "Error saving " + filename );
    else
    setVisible ( false );
    dispose();
    setVisible ( true );
    public void paint ( Graphics g )
    super.paint ( g );
    g.drawImage ( photo, 0, 0, getWidth(), getHeight(), Color.black, this );
    * Saves an image as a JPEG
    * @params the image to save
    * @params the filename to save the image as
    public boolean saveJPEG ( String filename )
    boolean saved = false;
    BufferedImage bi = new BufferedImage ( photo.getWidth(null),
    photo.getHeight(null),
    BufferedImage.TYPE_INT_RGB );
    Graphics2D g2 = bi.createGraphics();
    g2.drawImage ( photo, null, null );
    FileOutputStream out = null;
    try
    out = new FileOutputStream ( filename );
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder ( out );
    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam ( bi );
    param.setQuality ( 1.0f, false ); // 100% high quality setting, no compression
    encoder.setJPEGEncodeParam ( param );
    encoder.encode ( bi );
    out.close();
    saved = true;
    catch ( Exception ex )
    System.out.println ("Error saving JPEG : " + ex.getMessage() );
    return ( saved );
    } // of MySnapshot
    public static void main (String[] args )
    try
    JWebCam myWebCam = new JWebCam ( "Web Cam Capture" );
    myWebCam.setVisible ( true );
    if ( !myWebCam.initialise() )
    System.out.println ("Web Cam not detected / initialised");
    catch ( Exception ex )
    ex.printStackTrace();

  • Question about Kurts comments discussing the seperation of AIA & CDP - Test Lab Guide: Deploying an AD CS Two-Tier PKI Hierarchy - Kurt L Hudson MSFT

    Question about the sentence in bold. What is the meaning behind this comment?
    How would you separate the role of the AIA and CDP from a CA subordinate server? I can see where I add a CES and CEP server which has those as well, but I don't completely understand his comment. Because in this second step, (http://technet.microsoft.com/en-us/library/tlg-key-based-renewal.aspx)
    he shows how to implement CES and CEP.
    This is from the guide located at: http://technet.microsoft.com/library/hh831348.aspx
    Step 3: Configure APP1 to distribute certificates and CRLs
    In the extensions of the root CA, it was stated that the CRL from the root CA would be available via http://www.contoso.com/pki. Currently, there is not a PKI virtual directory on APP1, so one must be created.
    In a production environment, you would typically separate the issuing CA role from the role of hosting the AIA and CDP.
    However, this lab combines both in order to reduce the number of resources needed to complete the lab.
    Thanks,
    James

    My concern is, they have a 2-3k base of xp systems, over this year they are migrating them to Windows 7. During this time they will also be upgrading hardware for the existing windows 7 machines. The turnover of certificates are going to be high, which
    from what I've read here, it worries me.
    http://blogs.technet.com/b/askds/archive/2009/06/24/implementing-an-ocsp-responder-part-i-introducing-ocsp.aspx
    The application then can go to those locations to download the CRL. There are, however, some potential issues with this scenario. CRLs over time can get rather large
    depending on the number of certificates issued and revoked. If CRLs grow to a large size, and many clients have to download CRLs, this can have a negative impact on network performance. More importantly, by
    default Windows clients will timeout after 15 seconds while trying to download a CRL. Additionally,
    CRLs have information about every currently valid certificate that has been revoked, which is an excessive amount of data given the fact that an application may only need the revocation status for a few certificates. So,
    aside from downloading the CRL, the application or the OS has to parse the CRL and find a match for the serial number of the certificate that has been revoked.
    With the above limitations, which mostly revolve around scalability, it is clear that there are some drawbacks to using CRLs. Hence, the introduction of Online Certificate
    Status Protocol (OCSP). OCSP reduces the overhead associated with CRLs. There are server/client components to OCSP: The OCSP responder, which is the server component, and the OCSP Client. The OCSP Responder accepts status
    requests from OCSP Clients. When the OCSP Responder receives the request from the client it then needs to determine the status of the certificate using the serial number presented by the client. First the OCSP Responder determines if it has any cached responses
    for the same request. If it does, it can then send that response to the client. If there is no cached response, the OCSP Responder then checks to see if it has the CRL issued by the CA cached locally on the OCSP. If it does, it can check the revocation status
    locally, and send a response to the client stating whether the certificate is valid or revoked. The response is signed by the OCSP Signing Certificate that is selected during installation. If the OCSP does not have the CRL cached locally, the OCSP Responder
    can retrieve the CRL from the CDP locations listed in the certificate. The OCSP Responder then can parse the CRL to determine the revocation status, and send the appropriate response to the client.

  • Newbie Question. just installed IE7.. how do I set up a local host to preview sites?

    Sorry for the newbie question... but it's been a long time since I have done this
    Thanks!

    Just define your site in DW as always.  For a static site, that's all you need to do.

  • TS3297 I don't remember the my answers to the security questions --just bought this new iPad mini and can't make purchases. Please help.

    Just bought the new iPad mini --like it but can't purchase apps -- don't remember the answers to my security questions.

     Account Security Team (AST) 
    Check the AppleCare number for your country here:
    http://support.apple.com/kb/HE57
    Call them up, and let them know you would like to be transferred to the Account Security Team.

  • No Question, just example web cam capture code

    Hi,
    Since loads of people ask for an example of capturing pics from a web cam, here's one that captures pics, lets you take snapshots, which it displays in another frame. When you shut down the frame it asks if you want to save it to a JPEG.
    I'm mainly posting this to spite Eka_Kupkova, who only visits this forum to shamelessly advertise a commercial Twain based package in every single posting on this forum which mentions web cams.
    Notes : ( Could be more, read the install docs for JMF )
    1. you must download the "performance" version of jmf to capture video.
    2. I "think" you need to setup the JMF_HOME environment variable
    3. Run the jmfinit program to detect your camera and register it.
    I had to run it a couple of times before it worked.
    4. I had 2 icons for my toolbar, BtnFormat.jpg and BtnCapture.jpg.
    They were just 16 x 16 pixel bitmaps, you can make them up yourself.
    5. I assume you've got the webcam working and the driver installed already.
    Ps. if you find this useful, then reply back with where you are in the world. I'm in Dublin, Ireland.
    cheers,
    Owen
    import javax.swing.*;
    import javax.swing.border.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    // Ps. I think JMF 2.1.1c used a different package for this class..
    import com.sun.media.vfw.VFWCapture;
    public class JWebCam extends JFrame
                              implements WindowListener,
                                             ComponentListener
         protected final static int MIN_WIDTH  = 320;
         protected final static int MIN_HEIGHT = 240;
         protected static int shotCounter = 1;
         protected JLabel statusBar = null;
         protected Component visualComponent = null;
         protected JToolBar toolbar = null;
         protected MyToolBarAction formatButton  = null;
         protected MyToolBarAction captureButton = null;
        protected Player player = null;
        protected CaptureDeviceInfo webCamDeviceInfo = null;
        protected MediaLocator ml = null;
        protected Dimension imageSize = null;
        protected FormatControl formatControl = null;
        protected VideoFormat currentFormat = null;
        protected Format[] videoFormats = null;
        protected MyVideoFormat[] myFormatList = null;
          * Constructor
        public JWebCam ( String frameTitle )
             super ( frameTitle );
              try
                  UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
             catch ( Exception cnfe )
                  System.out.println ("Note : Cannot load look and feel settings");
             addWindowListener ( this );
             addComponentListener ( this );
             getContentPane().setLayout ( new BorderLayout() );
             statusBar = new JLabel ("Initialising...");
             statusBar.setBorder ( new EtchedBorder() );
             getContentPane().add ( statusBar, BorderLayout.SOUTH );
             setSize ( 320, 260 ); // default size...
             setVisible ( true );
          * Initialise
          * @returns true if web cam is detected
         public boolean initialise ( )
              throws Exception
              return ( initialise ( autoDetect() ) );
          * Initialise
          * @params _deviceInfo, specific web cam device if not autodetected
          * @returns true if web cam is detected
         public boolean initialise ( CaptureDeviceInfo _deviceInfo )
              throws Exception
              webCamDeviceInfo = _deviceInfo;
             if ( webCamDeviceInfo != null )
                  statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                  try
                        // setUpMenu ( );
                        setUpToolBar();
                        getContentPane().add ( toolbar, BorderLayout.NORTH );
                       ml = webCamDeviceInfo.getLocator();
                       if ( ml != null )
                          player = Manager.createRealizedPlayer ( ml );
                          if ( player != null )
                               formatControl = (FormatControl)player.getControl ( "javax.media.control.FormatControl" );
                                    videoFormats = webCamDeviceInfo.getFormats();
                                    setFormat ( (VideoFormat)videoFormats[0] );
                               // player.start();
                                    visualComponent = player.getVisualComponent();
                                    getContentPane().add ( visualComponent, BorderLayout.CENTER );
                                    invalidate();
                                    pack();
                                    setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
                                myFormatList = new MyVideoFormat[videoFormats.length];
                                for ( int i=0; i<videoFormats.length; i++ )
                                     myFormatList[i] = new MyVideoFormat ( (VideoFormat)videoFormats[i] );
                     else
                          statusBar.setText ( "No Media Locator for : " + webCamDeviceInfo.getName() );
                        return ( true );
                   catch ( IOException ioEx )
                       statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                        return ( false );
                   catch ( NoPlayerException npex )
                        statusBar.setText ("Cannot create player");
                        return ( false );
                   catch ( CannotRealizeException nre )
                        statusBar.setText ( "Cannot realize player");
                        return ( false );
             else
                  return ( false );
          * Dynamically create menu items
          * @returns the device info object if found, null otherwise
         public void setFormat ( VideoFormat selectedFormat )
              if ( formatControl != null )
                   player.stop();
                   statusBar.setText ( "Format : " + selectedFormat );
                   imageSize = selectedFormat.getSize();
                   formatControl.setFormat ( selectedFormat );
                   currentFormat = selectedFormat;
                   setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
                   player.start();
              else
                   System.out.println ("Visual component not an instance of FormatControl");
                   statusBar.setText ( "Visual component cannot change format" );
         protected void setUpToolBar ( )
              toolbar = new JToolBar();
              formatButton  = new MyToolBarAction ( "Format",  "BtnFormat.jpg" );
              captureButton = new MyToolBarAction ( "Capture", "BtnCapture.jpg" );
              if ( formatButton != null )
                    toolbar.add ( formatButton );
              toolbar.add ( captureButton );
              getContentPane().add ( toolbar, BorderLayout.NORTH );
         protected void toolbarHandler ( MyToolBarAction actionBtn )
              if ( actionBtn == formatButton )
                      // JOptionPane.showConfirmDialog ( this, "Format Dialog" );
                      Object selected = JOptionPane.showInputDialog (this,
                                                                     "Select Video format",
                                                                     "Capture format selection",
                                                                     JOptionPane.INFORMATION_MESSAGE,
                                                                     null,          //     Icon icon,
                                                                     myFormatList, // videoFormats,
                                                                     currentFormat );
                   if ( selected != null )
                        setFormat ( ((MyVideoFormat)selected).format );
              else if ( actionBtn == captureButton )
                   Image photo = grabFrameImage ( );
                   MySnapshot snapshot = new MySnapshot ( photo, new Dimension ( imageSize ) );
          * autoDetects the first web camera in the system
          * @returns the device info object if found, null otherwise
        public CaptureDeviceInfo autoDetect ( )
              Vector list = CaptureDeviceManager.getDeviceList ( null );
              CaptureDeviceInfo devInfo = null;
              if ( list != null )
                   String name;
                   for ( int i=0; i<list.size(); i++ )
                        devInfo = (CaptureDeviceInfo)list.elementAt ( i );
                        name = devInfo.getName();
                      if ( name.startsWith ("vfw:") )
                            break;
                   if ( devInfo != null && devInfo.getName().startsWith("vfw:") )
                       return ( devInfo );
                   else
                      for ( int i = 0; i < 10; i++ )
                           try
                               name = VFWCapture.capGetDriverDescriptionName ( i );
                               if (name != null && name.length() > 1)
                                       devInfo = com.sun.media.protocol.vfw.VFWSourceStream.autoDetect ( i );
                                       if ( devInfo != null )
                                            return ( devInfo );
                             catch ( Exception ioEx )
                                  // ignore errors detecting device
                                  statusBar.setText ( "AutoDetect failed : " + ioEx.getMessage() );
                       return ( null );
              else
                   return ( null );
          * deviceInfo
          * @note outputs text information
         public void deviceInfo ( )
             if ( webCamDeviceInfo != null )
                  Format[] formats = webCamDeviceInfo.getFormats();
                  if ( ( formats != null ) && ( formats.length > 0 ) )
                  for ( int i=0; i<formats.length; i++ )
                       Format aFormat = formats;
                   if ( aFormat instanceof VideoFormat )
                        Dimension dim = ((VideoFormat)aFormat).getSize();
                        System.out.println ("Video Format " + i + " : " + formats[i].getEncoding() + ", " + dim.width + " x " + dim.height );
                   else
                        System.out.println ("Format " + i + " : " + formats[i].getEncoding() );
         else
              System.out.println ("Error : No web cam detected");
         * grabs a frame's buffer from the web cam / device
         * @returns A frames buffer
         public Buffer grabFrameBuffer ( )
              if ( player != null )
    FrameGrabbingControl fgc = (FrameGrabbingControl)player.getControl ( "javax.media.control.FrameGrabbingControl" );
    Buffer buf = fgc.grabFrame();
    return ( buf );
    else
         return ( null );
         * grabs a frame's buffer, as an image, from the web cam / device
         * @returns A frames buffer as an image
         public Image grabFrameImage ( )
              Buffer buffer = grabFrameBuffer();
              if ( buffer != null )
    // Convert it to an image
    BufferToImage btoi = new BufferToImage ( (VideoFormat)buffer.getFormat() );
    Image image = btoi.createImage ( buffer );
    return ( image );
              else
                   System.out.println ("Error : Buffer grabbed is null");
                   return ( null );
         * Closes and cleans up the player
         public void playerClose ( )
              if ( player != null )
         player.close();
         player.deallocate();
         player = null;
         public void windowClosing ( WindowEvent e )
              playerClose();
              System.exit ( 1 );
         public void componentResized(ComponentEvent e)
              Dimension dim = getSize();
              boolean mustResize = false;
              if ( dim.width < MIN_WIDTH )
              dim.width = MIN_WIDTH;
              mustResize = true;
              if ( dim.height < MIN_HEIGHT )
                   dim.height = MIN_HEIGHT;
                   mustResize = true;
              if ( mustResize )
                   setSize ( dim );
         public void windowActivated ( WindowEvent e )      {       }
         public void windowClosed ( WindowEvent e )      {       }
         public void windowDeactivated ( WindowEvent e )     {     }
         public void windowDeiconified ( WindowEvent e )     {     }
         public void windowIconified ( WindowEvent e )     {     }
         public void windowOpened ( WindowEvent e )          {     }
         public void componentHidden(ComponentEvent e)      {       }
         public void componentMoved(ComponentEvent e)     {     }
         public void componentShown(ComponentEvent e)     {     }
         protected void finalize     ( ) throws Throwable
              playerClose();
              super.finalize();
         class MyToolBarAction extends AbstractAction
              public MyToolBarAction ( String name, String imagefile )
                   super ( name, new ImageIcon ( imagefile ) );
              public void actionPerformed ( ActionEvent event )
                   toolbarHandler ( this );
         class MyVideoFormat
              public VideoFormat format;
              public MyVideoFormat ( VideoFormat _format )
                   format = _format;
              public String toString ( )
                   Dimension dim = format.getSize();
                   return ( format.getEncoding() + " [ " + dim.width + " x " + dim.height + " ]" );
         class MySnapshot extends JFrame
              protected Image photo = null;
              protected int shotNumber;
              public MySnapshot ( Image grabbedFrame, Dimension imageSize )
                   super ( );
                   shotNumber = shotCounter++;
                   setTitle ( "Photo" + shotNumber );
                   photo = grabbedFrame;
                   setDefaultCloseOperation ( WindowConstants.DO_NOTHING_ON_CLOSE );
                   int imageHeight = photo.getWidth ( this );
                   int imageWidth = photo.getHeight ( this );
                   setSize ( imageSize.width, imageSize.height );
                   final FileDialog saveDialog = new FileDialog ( this, "Save JPEG", FileDialog.SAVE );
                   final JFrame thisCopy = this;
                   saveDialog.setFile ( "Photo" + shotNumber );
                   addWindowListener ( new WindowAdapter()
                             public void windowClosing ( WindowEvent e )
                                  saveDialog.show();
                                  String filename = saveDialog.getFile();
                                  if ( filename != null )
                                       if ( saveJPEG ( filename ) )
                                            JOptionPane.showMessageDialog ( thisCopy, "Saved " + filename );
                                            setVisible ( false );
                                            dispose();
                                       else
                                            JOptionPane.showMessageDialog ( thisCopy, "Error saving " + filename );
                                  else
                                       setVisible ( false );
                                       dispose();
                   setVisible ( true );
              public void paint ( Graphics g )
                   g.drawImage ( photo, 0, 0, getWidth(), getHeight(), this );
              * Saves an image as a JPEG
              * @params the image to save
              * @params the filename to save the image as
         public boolean saveJPEG ( String filename )
              boolean saved = false;
         BufferedImage bi = new BufferedImage ( photo.getWidth(null),
         photo.getHeight(null),
         BufferedImage.TYPE_INT_RGB );
         Graphics2D g2 = bi.createGraphics();
         g2.drawImage ( photo, null, null );
         FileOutputStream out = null;
         try
         out = new FileOutputStream ( filename );
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder ( out );
              JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam ( bi );
              param.setQuality ( 1.0f, false );
              encoder.setJPEGEncodeParam ( param );
              encoder.encode ( bi );
              out.close();
              saved = true;
         catch ( Exception ex )
         System.out.println ("Error saving JPEG : " + ex.getMessage() );
         return ( saved );
         }     // of MySnapshot
    public static void main (String[] args )
         try
              JWebCam myWebCam = new JWebCam ( "TimeSlice Web Cam Capture" );
              if ( myWebCam.initialise() )
                   // myWebCam.deviceInfo(); // outputs device info
              else
                   System.out.println ("Web Cam not detected / initialised");
         catch ( Exception ex )
              ex.printStackTrace();

    Doohhh... I posted an old version which didn't work.
    I tried and tested this last night, and it runs grand using Ver 2.1.1e.
    Tested under Windows 98, using an old Creative GO Camera.
    Haven't tried it under Linux, but suspect you'd have to at least change an references to "vfw" to "v4l".
    You'll need jmf.jar in your classpath to run it too.
    cheers,
    Owen
    import javax.swing.*;
    import javax.swing.border.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.datasink.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    // import com.sun.media.vfw.VFWCapture;         // JMF 2.1.1c version
    import com.sun.media.protocol.vfw.VFWCapture;   // JMF 2.1.1e version
    public class JWebCam extends JFrame
        implements WindowListener,  ComponentListener
        protected final static int MIN_WIDTH  = 320;
        protected final static int MIN_HEIGHT = 240;
        protected static int shotCounter = 1;
        protected JLabel statusBar = null;
        protected JPanel visualContainer = null;
        protected Component visualComponent = null;
        protected JToolBar toolbar = null;
        protected MyToolBarAction formatButton    = null;
        protected MyToolBarAction captureButton   = null;
        protected Player player = null;
        protected CaptureDeviceInfo webCamDeviceInfo = null;
        protected MediaLocator ml = null;
        protected Dimension imageSize = null;
        protected FormatControl formatControl = null;
        protected VideoFormat currentFormat = null;
        protected Format[] videoFormats = null;
        protected MyVideoFormat[] myFormatList = null;
        protected boolean initialised = false;
         * Constructor
        public JWebCam ( String frameTitle )
            super ( frameTitle );
            try
                UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
            catch ( Exception cnfe )
                System.out.println ("Note : Cannot load look and feel settings");
            setSize ( 320, 260 ); // default size...
            addWindowListener ( this );
            addComponentListener ( this );
            getContentPane().setLayout ( new BorderLayout() );
            visualContainer = new JPanel();
            visualContainer.setLayout ( new BorderLayout() );
            getContentPane().add ( visualContainer, BorderLayout.CENTER );
            statusBar = new JLabel ("");
            statusBar.setBorder ( new EtchedBorder() );
            getContentPane().add ( statusBar, BorderLayout.SOUTH );
         * Initialise
         * @returns true if web cam is detected
        public boolean initialise ( )
            throws Exception
            return ( initialise ( autoDetect() ) );
         * Initialise
         * @params _deviceInfo, specific web cam device if not autodetected
         * @returns true if web cam is detected
        public boolean initialise ( CaptureDeviceInfo _deviceInfo )
            throws Exception
            statusBar.setText ( "Initialising...");
            webCamDeviceInfo = _deviceInfo;
            if ( webCamDeviceInfo != null )
                statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                try
                    setUpToolBar();
                    getContentPane().add ( toolbar, BorderLayout.NORTH );
                    ml = webCamDeviceInfo.getLocator();
                    if ( ml != null )
                        player = Manager.createRealizedPlayer ( ml );
                        if ( player != null )
                            player.start();
                            formatControl = (FormatControl)player.getControl ( "javax.media.control.FormatControl" );
                            videoFormats = webCamDeviceInfo.getFormats();
                            visualComponent = player.getVisualComponent();
                            if ( visualComponent != null )
                                visualContainer.add ( visualComponent, BorderLayout.CENTER );
                                myFormatList = new MyVideoFormat[videoFormats.length];
                                for ( int i=0; i<videoFormats.length; i++ )
                                    myFormatList[i] = new MyVideoFormat ( (VideoFormat)videoFormats[i] );
                                Format currFormat = formatControl.getFormat();
                                if ( currFormat instanceof VideoFormat )
                                     currentFormat = (VideoFormat)currFormat;
                                     imageSize = currentFormat.getSize();
                                     visualContainer.setPreferredSize ( imageSize );
                                     setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
                                else
                                    System.err.println ("Error : Cannot get current video format");
                                invalidate();
                                pack();
                                return ( true );
                            else
                                System.err.println ("Error : Could not get visual component");
                                return ( false );
                        else
                            System.err.println ("Error : Cannot create player");
                            statusBar.setText ( "Cannot create player" );
                            return ( false );
                    else
                        System.err.println ("Error : No MediaLocator for " + webCamDeviceInfo.getName() );
                        statusBar.setText ( "No Media Locator for : " + webCamDeviceInfo.getName() );
                        return ( false );
                catch ( IOException ioEx )
                    statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
                    return ( false );
                catch ( NoPlayerException npex )
                    statusBar.setText ("Cannot create player");
                    return ( false );
                catch ( CannotRealizeException nre )
                    statusBar.setText ( "Cannot realize player");
                    return ( false );
            else
                return ( false );
         * Dynamically create menu items
         * @returns the device info object if found, null otherwise
        public void setFormat ( VideoFormat selectedFormat )
            if ( formatControl != null )
                player.stop();
                imageSize = selectedFormat.getSize();
                formatControl.setFormat ( selectedFormat );
                player.start();
                statusBar.setText ( "Format : " + selectedFormat );
                currentFormat = selectedFormat;
                visualContainer.setPreferredSize ( currentFormat.getSize() );
                setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
            else
                System.out.println ("Visual component not an instance of FormatControl");
                statusBar.setText ( "Visual component cannot change format" );
        public VideoFormat getFormat ( )
            return ( currentFormat );
        protected void setUpToolBar ( )
            toolbar = new JToolBar();
            // Note : If you supply the 16 x 16 bitmaps then you can replace
            // the commented line in the MyToolBarAction constructor
            formatButton    = new MyToolBarAction ( "Resolution", "BtnFormat.jpg" );
            captureButton   = new MyToolBarAction ( "Capture",    "BtnCapture.jpg" );
            toolbar.add ( formatButton );
            toolbar.add ( captureButton );
            getContentPane().add ( toolbar, BorderLayout.NORTH );
        protected void toolbarHandler ( MyToolBarAction actionBtn )
            if ( actionBtn == formatButton )
                Object selected = JOptionPane.showInputDialog (this,
                                                               "Select Video format",
                                                               "Capture format selection",
                                                               JOptionPane.INFORMATION_MESSAGE,
                                                               null,        //  Icon icon,
                                                               myFormatList, // videoFormats,
                                                               currentFormat );
                if ( selected != null )
                    setFormat ( ((MyVideoFormat)selected).format );
            else if ( actionBtn == captureButton )
                Image photo = grabFrameImage ( );
                if ( photo != null )
                    MySnapshot snapshot = new MySnapshot ( photo, new Dimension ( imageSize ) );
                else
                    System.err.println ("Error : Could not grab frame");
         * autoDetects the first web camera in the system
         * searches for video for windows ( vfw ) capture devices
         * @returns the device info object if found, null otherwise
        public CaptureDeviceInfo autoDetect ( )
            Vector list = CaptureDeviceManager.getDeviceList ( null );
            CaptureDeviceInfo devInfo = null;
            if ( list != null )
                String name;
                for ( int i=0; i<list.size(); i++ )
                    devInfo = (CaptureDeviceInfo)list.elementAt ( i );
                    name = devInfo.getName();
                    if ( name.startsWith ("vfw:") )
                        break;
                if ( devInfo != null && devInfo.getName().startsWith("vfw:") )
                    return ( devInfo );
                else
                    for ( int i = 0; i < 10; i++ )
                        try
                            name = VFWCapture.capGetDriverDescriptionName ( i );
                            if (name != null && name.length() > 1)
                                devInfo = com.sun.media.protocol.vfw.VFWSourceStream.autoDetect ( i );
                                if ( devInfo != null )
                                    return ( devInfo );
                        catch ( Exception ioEx )
                            // ignore errors detecting device
                            statusBar.setText ( "AutoDetect failed : " + ioEx.getMessage() );
                    return ( null );
            else
                return ( null );
         * deviceInfo
         * @note outputs text information
        public void deviceInfo ( )
            if ( webCamDeviceInfo != null )
                Format[] formats = webCamDeviceInfo.getFormats();
                if ( ( formats != null ) && ( formats.length > 0 ) )
                for ( int i=0; i<formats.length; i++ )
                    Format aFormat = formats;
    if ( aFormat instanceof VideoFormat )
    Dimension dim = ((VideoFormat)aFormat).getSize();
    // System.out.println ("Video Format " + i + " : " + formats[i].getEncoding() + ", " + dim.width + " x " + dim.height );
    else
    System.out.println ("Error : No web cam detected");
    * grabs a frame's buffer from the web cam / device
    * @returns A frames buffer
    public Buffer grabFrameBuffer ( )
    if ( player != null )
    FrameGrabbingControl fgc = (FrameGrabbingControl)player.getControl ( "javax.media.control.FrameGrabbingControl" );
    if ( fgc != null )
    return ( fgc.grabFrame(); );
    else
    System.err.println ("Error : FrameGrabbingControl is null");
    return ( null );
    else
    System.err.println ("Error : Player is null");
    return ( null );
    * grabs a frame's buffer, as an image, from the web cam / device
    * @returns A frames buffer as an image
    public Image grabFrameImage ( )
    Buffer buffer = grabFrameBuffer();
    if ( buffer != null )
    // Convert it to an image
    BufferToImage btoi = new BufferToImage ( (VideoFormat)buffer.getFormat() );
    if ( btoi != null )
    Image image = btoi.createImage ( buffer );
    if ( image != null )
    return ( image );
    else
    System.err.println ("Error : BufferToImage cannot convert buffer");
    return ( null );
    else
    System.err.println ("Error : cannot create BufferToImage instance");
    return ( null );
    else
    System.out.println ("Error : Buffer grabbed is null");
    return ( null );
    * Closes and cleans up the player
    public void playerClose ( )
    if ( player != null )
    player.close();
    player.deallocate();
    player = null;
    public void windowClosing ( WindowEvent e )
    playerClose();
    System.exit ( 1 );
    public void componentResized ( ComponentEvent e )
    Dimension dim = getSize();
    boolean mustResize = false;
    if ( dim.width < MIN_WIDTH )
    dim.width = MIN_WIDTH;
    mustResize = true;
    if ( dim.height < MIN_HEIGHT )
    dim.height = MIN_HEIGHT;
    mustResize = true;
    if ( mustResize )
    setSize ( dim );
    public void windowActivated ( WindowEvent e ) {   }
    public void windowClosed ( WindowEvent e ) {   }
    public void windowDeactivated ( WindowEvent e ) {   }
    public void windowDeiconified ( WindowEvent e ) {   }
    public void windowIconified ( WindowEvent e ) {   }
    public void windowOpened ( WindowEvent e ) {   }
    public void componentHidden(ComponentEvent e) {   }
    public void componentMoved(ComponentEvent e) {   }
    public void componentShown(ComponentEvent e) {   }
    protected void finalize ( ) throws Throwable
    playerClose();
    super.finalize();
    class MyToolBarAction extends AbstractAction
    public MyToolBarAction ( String name, String imagefile )
    // Note : Use version this if you supply your own toolbar icons
    // super ( name, new ImageIcon ( imagefile ) );
    super ( name );
    public void actionPerformed ( ActionEvent event )
    toolbarHandler ( this );
    class MyVideoFormat
    public VideoFormat format;
    public MyVideoFormat ( VideoFormat _format )
    format = _format;
    public String toString ( )
    Dimension dim = format.getSize();
    return ( format.getEncoding() + " [ " + dim.width + " x " + dim.height + " ]" );
    class MySnapshot extends JFrame
    protected Image photo = null;
    protected int shotNumber;
    public MySnapshot ( Image grabbedFrame, Dimension imageSize )
    super ( );
    shotNumber = shotCounter++;
    setTitle ( "Photo" + shotNumber );
    photo = grabbedFrame;
    setDefaultCloseOperation ( WindowConstants.DISPOSE_ON_CLOSE );
    int imageHeight = photo.getWidth ( this );
    int imageWidth = photo.getHeight ( this );
    setSize ( imageSize.width, imageSize.height );
    final FileDialog saveDialog = new FileDialog ( this, "Save JPEG", FileDialog.SAVE );
    final JFrame thisCopy = this;
    saveDialog.setFile ( "Photo" + shotNumber );
    addWindowListener ( new WindowAdapter()
    public void windowClosing ( WindowEvent e )
    saveDialog.show();
    String filename = saveDialog.getFile();
    if ( filename != null )
    if ( saveJPEG ( filename ) )
    JOptionPane.showMessageDialog ( thisCopy, "Saved " + filename );
    setVisible ( false );
    dispose();
    else
    JOptionPane.showMessageDialog ( thisCopy, "Error saving " + filename );
    else
    setVisible ( false );
    dispose();
    setVisible ( true );
    public void paint ( Graphics g )
    g.drawImage ( photo, 0, 0, getWidth(), getHeight(), this );
    * Saves an image as a JPEG
    * @params the image to save
    * @params the filename to save the image as
    public boolean saveJPEG ( String filename )
    boolean saved = false;
    BufferedImage bi = new BufferedImage ( photo.getWidth(null),
    photo.getHeight(null),
    BufferedImage.TYPE_INT_RGB );
    Graphics2D g2 = bi.createGraphics();
    g2.drawImage ( photo, null, null );
    FileOutputStream out = null;
    try
    out = new FileOutputStream ( filename );
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder ( out );
    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam ( bi );
    param.setQuality ( 1.0f, false ); // 100% high quality setting, no compression
    encoder.setJPEGEncodeParam ( param );
    encoder.encode ( bi );
    out.close();
    saved = true;
    catch ( Exception ex )
    System.out.println ("Error saving JPEG : " + ex.getMessage() );
    return ( saved );
    } // of MySnapshot
    public static void main (String[] args )
    try
    JWebCam myWebCam = new JWebCam ( "TimeSlice Web Cam Capture" );
    myWebCam.setVisible ( true );
    if ( !myWebCam.initialise() )
    System.out.println ("Web Cam not detected / initialised");
    catch ( Exception ex )
    ex.printStackTrace();

Maybe you are looking for

  • I-tunes was saving my music to the wrong location.

    If I choose the option to have i-tunes organize my media and consolidate my collection, can I delete the files in the original location safely? As I understand it is now copying them to the correct location and I can't afford the space in the area (p

  • Reg: Purchase order no from accounting document no

    hi, I have to generate a report of vendor billing details,where i have to get the corresponding purchase order no for accounting document no.From bseg i am getting the ebeln field but i have fetched based on posting key bschl ='86' or '81'.for the co

  • CST condition in PO

    Hi MM Gurus We are using TAXINN  tax procedure When i am creating a PO for a Vendor,material ,plant combination Excise duty is nill and CST is 4 % I have maintained the conditon record in FV11 for condition type JVCS as 4 % and tax code as V5 In the

  • How do i set artist info on my movies?

    Since itunes 12, i cannot update ANY ACTUAL useful fields on my home movies, downloaded video tutorials, or generally ANYTHING ACTUALLY FUNCTIONAL for the movie/home video functions! *** did you do Apple?

  • Error with Desktop Integration on Macs

    My JWS program runs fine on several Macs (running on 1.4.2-XX and 1.5), however, whenever I try to use the desktop integration, I get an error creating the shortcuts. There are no problems on Windows clients.