JTextPane -captured image refreshing problem

Dear All,
In my application it is necessary to capture the
screen and save it as jpeg and display the same in a JTextPane using <img> tag.
I have made use of com.sun.image.codec.jpeg to save the image and it works fine.
After starting the application the
first picture is displayed well but the other pictures though get saved is not displayed in the JTextPane.Only the previous picture remains.
I have made use of new Instance of TextPane each time.All the captured images are saved in the same name say "images/screenshot.jpg" one at a time.
Please tell me what would be the problem.
Expecting your reply
Thanks and Best Regards,
AnushaJv

Try to remove text from the document and set it again.
JtextPane pane;
Document doc=pane.getDocument();
String content=doc.getText(0,doc.getLength());
doc.setText("");
doc.setText(content);
best regards
Stas

Similar Messages

  • Image refresh problem

    hi, i have an image inside an iframe that i'm trying to
    change upon the click of a button. i use the following code:
    <SCRIPT language="JavaScript" type="text/javascript">
    function swapImage(intImage){
    var
    imgs=["images/pic0.jpg","images/pic1.jpg","images/pic2.jpg","images/pic3.jpg","images/pic 4.jpg",
    "images/pic5.jpg"];
    parent.frames['cont'].document.getElementById('mgmnt_pic').src =
    imgs[intImage];
    alert(parent.frames['cont'].document.getElementById('mgmnt_pic').src)
    </SCRIPT>
    then in body:
    <p><a href="javascript:; "
    onclick="frames['cont'].swapImage(0);">Management
    Team</a></p>
    i know from the alert that it is changing the source of my
    image, the problem is that the image itself is not changing at all.
    has anyone experienced this before? what can i do to fix it?

    Hi,
    chk the link
    http://javascript.internet.com/miscellaneous/random-image.html
    shanthi

  • Is it possible to capture image at specified wavelength​s

    The filter is attached to camera. The filter is switching betweeen   5 specified wavelengths. On giving the "Start Aquisition" button the camera will capture image. the problems are
    1)  the wavelength selection is written as  subvi. It changes the wavelengths , but the control returns to the calling vi only with the final wavlength( here 686.7). The other values are not reflected in the main vi.
    2)  on giving the "start aquisition" the image taken is for this final wavelength. Is it possible to take images for all the 5 wavelengths by giving "start aquisition" only at the beginning?
    3)  Now the execution control loops inside the section which captures the image( since I have given a while loop there)
    4) instead of this sub filter vi, is it possible to add a sweep program( i already have one) so that when the desired wavelength values come it will capture the image.
    Attachments:
    image changed2.vi ‏251 KB
    subfilter.vi ‏22 KB
    sweep.vi ‏22 KB

    Your code shows a complete lack of understanding of dataflow programming. Maybe you should start out with a few tutorials and study some example programs from the example finder.
    How are you running the code? Run continuously??? There is no toplevel loop! It is difficult to say more, because most subVIs are missing so we cannot even test.
    Your toplevel is unmaintainable, with loops and sequence structures stacked knee deep. Have a look at state machine architecture instead. Your only seem to work if controls are operated in a specific sequence. Most of the time, controls will not respond because the code does something else.
    Your "sweep program makes no sense. Why are you setting a value property that overwrites a control, making the control useless. Only use controls if the user can actually change something. Why not just initialize the shift register with a diagram constant of 400? After you do that, the sequence structure is obsolete, delete it. Why is there a local variable? Why don't you delete the local variable and place the indicator in its place inside the loop? 
    Your subfilter code makes no sense. Nothing will happen in the main VI while it is running. Data is only returned at the output terminal once the VI is finished. It does not change any wavelenghts as you claim, it simply updates it's front panel. What else do you expect? Why don't you flatten that code in the main VI, simply autoindexing an array with three wavelents in the loop that does the acquisition. Why does the output go to a case strucure with only choices 0 and 1? Since none of the outputs will ever be 0 or 1, only the empty default case will ever execute.
    LabVIEW Champion . Do more with less code and in less time .

  • Problem deploying captured image

    I'm testing our new SCCM 2012 and specifically OSD and deploying a captured image. The image is captured on a separate MDT config.
    What I'm seeing with this image deployment is that about 90% of the times it ends with a 80070002 TS error. Examining the smsts.log shows the following:
    Successfully completed the action (Setup Windows and ConfigMgr) with the exit win32 code 0
    So this step seems to go fine and and then the State Restore step starts and the computer reboots to the full OS.
    The group (State Restore) has been successfully started
    But then I don't know what happens, non of the following steps are run, for example there's application install and so forth. It seems to parse through the remaining steps but doesn't run them and then ends with Gather Logs and stateStore on Failure.
    I just can't see from smsts.log what the problem would be, what other logs should I look in to find out what's going on?

    Seen that many times when doing deployments, but not on capture mentioned. In that case the error is a known bug. Workaround is to add 2 Task Sequence Variables. Unfortunately R2 is needed for that.
    -SMSTSDownloadRetryCount = 5
    -SMSTSDownloadRetryDelay = 15
    Just have a look at my blogpost for more information on this:
    http://henkhoogendoorn.blogspot.nl/2014/07/osd-ts-fails-during-package-download.html
    My blogs: Henk's blog and
    Virtuall | Follow Me on:
    Twitter | View My Profile on:
    LinkedIn

  • Refreshment problem when place image.

    Hi Experts,
    When I insert image using script then there is a refreshment problem.
    In place of second image there place first image.
    while if I debug this it place in correct order. But in Run case script not place image in order.
    There is a refreshment problem After place First image it not refresh  and have first image.
    How solve this problem That i place image in proper order in Script Run mode.
    #target indesign
    var myDocument=app.activeDocument;        //Active document have 10 spread with text frame
    for(int i=0; i<10;i++)
    var ImagePath="D:\Indesign\" + i + ".indd";         // There are 0.indd to 9.indd, 10 image in "D:\Indesign\"
    var myTextFrame=myDocument.spreads.item(i).textFrames.firstItem();
    myTextFrame.place(File(ImagePath)); // ImagePath is path of image
    Thanks.

    My problem is like this :
    I want place image in a text box
    File(menu)-->place....-->(Dialog open then Select Image file then click on open)->then image is attach  with cursor. (I do not click on .indd open screen).
    Now I run the script from ExtendedTool Kit
    #target indesign
    var myDocument=app.activeDocument;
    var myTextFrame=myDocument.spreads.item(0).textFrames.firstItem();
    $.sleep(2000);
    myTextFrame.place(File("/C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/temp.jpg"));
    $.sleep(2000);
    var graphic=myTextFrame.allGraphics[0];
    graphic.select(SelectionOptions.REPLACE_WITH);
    graphic.geometricBounds =["-47.853527","-157.370275","1231.018230","709.576702"];
    When this script run then it place the image which I am select from File(menu)-->place....-->(Dialog open then Select Image file then click on open).
    Not from the path "/C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/temp.jpg"
    This is the problem to place image.  So there is image duplicasy and some image missing.
    Is there is solution of this problem ?
    How remove image which is already attach with cursor ?
    Thanks.

  • Problem with capturing image

    http://1drv.ms/1jWJ5a3
    Problem with capturing image. Logs included.
    Also after deploying letters are swapped. System is on D drive, and data on C drive.
    Any idea ?

    Based on the logfiles:
    SMSSITECODE=K01
    SMSMP=SCCM.kolubara.local
    you could also use DNSSUFFIX=kolubara.local
    More on CCMSetup parameters can be found here
    http://technet.microsoft.com/en-us/library/gg699356.aspx. Use client.msi parameters in your task sequence separated by spaces, so that your Setup Windows & Configuration Manager Client -step looks like this:

  • Problem with capture image from wc

    hi all, i want to capture image from my webcam and play it, but it's not work
    please help me, here's code
    public class Demo extends JFrame {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Demo demo = new Demo();
         public Demo() {
              super();
              int a=30;
              final JPanel panel = new JPanel();
              getContentPane().add(panel, BorderLayout.CENTER);
              setVisible(true);
              DataSource dataSource = null;
              PushBufferStream pbs;
              Vector deviceList = CaptureDeviceManager.getDeviceList(new VideoFormat(null));
              CaptureDeviceInfo deviceInfo=null;boolean VideoFormatMatch=false;
              for(int i=0;i<deviceList.size();i++) {
              // search for video device
              deviceInfo = (CaptureDeviceInfo)deviceList.elementAt(i);
              if(deviceInfo.getName().indexOf("vfw:/")<0)continue;
              VideoFormat videoFormat=new VideoFormat("YUV");
              System.out.println("Format: "+ videoFormat.toString());
              Dimension size= videoFormat.getSize();
              panel.setSize(size.width,size.height);
              MediaLocator loc = deviceInfo.getLocator();
              try {
                   dataSource = (DataSource) Manager.createDataSource(loc);
                   // dataSource=Manager.createCloneableDataSource(dataSource);
                   } catch(Exception e){}
                   Thread.yield();
                   try {
                        pbs=(PushBufferStream) dataSource.getStreams()[0];
                        ((com.sun.media.protocol.vfw.VFWSourceStream)pbs).DEBUG=true;
                        } catch(Exception e){}
                        Thread.yield();
                        try{dataSource.start();}catch(Exception e){System.out.println("Exception dataSource.start() "+e);}
                        Thread.yield();
                        try{Thread.sleep(1000);}catch(Exception e){} // to let camera settle ahead of processing
    }

    iTool wrote:
    hi all, i want to capture image from my webcam and play it, but it's not workThat's a very descriptive error message, "it's not work". Everyone on the board will certainly be able to help you out with that.
    The first error I see is that you're using the CaptureDeviceManager in an applet. If T.B.M pops in here, he can tell you why that's going to be a CF 99% of the time.
    The other error I see is that your code looks absolutely nothing like any working JMF webcam capture code I've personally ever seen.
    Lastly, the big one, even if you were somehow capturing video magically, you're not even trying to display it...so I'm not entirely sure why you expect to see anything with the code you just posted.
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JVidCap.html]
    Your best bet would be starting over and using the example code from the page linked above.

  • WDS Capture Image Blank Screen with Cursor

    Hey everyone, happy Friday and Happy Sysadmin Day!
    Not super happy for myself unfortunately! I'm having a problem with a Capture Image in WDS. I have a Sysprepped Dell 6440 running Windows 7 x64.I've created a Capture Image in WDS from a boot image with drivers injected and without drivers injected, but every time I boot from PXE, it gets to the windows loading screen, and then it just shows a blank screen with a cursor.I'm using Microsoft's OpenLicense ISO as a base for the boot.wimI can't find any solution that works. I've tried mounting and unmounting the WIM, restarting WDS, etc. This is getting really frustrating as I'm so close to having these images ready.The blank screen won't do anything, won't open a cmd with Shift+
    F10 or anything. I've also tried booting on a different machine and it does the same thing.Any suggestions are...
    This topic first appeared in the Spiceworks Community

    HI @Moonrod ,
    Welcome to the HP Forums!
    It is a super place to find answers and information!
    For you to have the best experience in the HP forum I would like to direct your attention to the HP Forums Guide Learn How to Post and More
    I grasp you were unable to do a refresh you PC as you received the message that the drive was locked.
    Please refer to my post Re: Can't refresh or reset windows 8.1 because drive is locked
    Here is a link from the windowsclub.com that may also be informative.
    Fix: The drive where Windows is installed is locked.
    Best of Luck!
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • How capture image at 800*600 from videocapture at 640*480??

    the device can capture image at 1600*1200 max, but videocapture is only at 640 * 480.
    Im using JMF.
    Thanks.

    Have u checked your refresh rates (you can set refresh rates from the drivers - for games (older drivers had this feature only for OpenGL, now they have it for D3D as well) -> in the advanced section). I'm not sure that this is the problem, but it' worth giving it a try.

  • Unable to capture images since upgrade to MDT 2013

    I recently updated MDT 2012 to MDT 2013 to enable support for Windows 8.1. Under MDT 2012 I was able to both capture and deploy images without an issue. Since upgrading to MDT 2013 I've had nothing but grief. When I launch my Sysprep and Capture task I am
    returned with the following error:
    Error creating an image of drive D:, rc=2ZTI ERROR -Non-zero return code by ZTIBackup, rc=2Litetouch deployment failed, Return Code = -2147467259 0x80004005
    Failed to run the action: Create WIM.
    The system cannot find the file specified. (Error: 00000002; Source: Windows)
    The execution of the group (Capture Image) has failed and the execution has been aborted.
    An action failed.
    Operation aborted (Error: 80004004; Source Windows)
    Failed to run the last action Create WIM.  Execution of task sequence failed.
    The system cannot find the file specified.  (Error 00000002; Source: Windows)
    Task Sequence Engine Failed!  Code: enExecutionFail
    Task sequence execution failed with error code 80004005
    Error TAsk Sequence Manager failed to execute task sequence.  Code 0x80004005
    Once the machine boots up again I check the BDD log located in C:\Windows\Temp\DeploymentLogs and notice the following error:
    <![LOG[  Console > Error opening file [\\rmh-vm-mdt2012\DeploymentShare$\Captures\WINDOWS.8.1.REF.wim].]LOG]!><time="10:23:55.000+000" date="02-06-2014" component="ZTIBackup" context="" type="1"
    thread="" file="ZTIBackup">
    <![LOG[  Console > Access is denied. ]LOG]!><time="10:23:55.000+000" date="02-06-2014" component="ZTIBackup" context="" type="1" thread="" file="ZTIBackup">
    My issue appears to be a permissions problem.  For troubleshooting purposes I've given Everyone full access to \DeploymentShare$ however the problem continues to persist. 
    I'm not sure where to go from here.  Hoping someone can help. 
    Thanks.

    Additionally, ensure that the share itself is marked R/W access.
    As a test, boot to WinPE and try to create a file, any file on the share.
    However, Lordy86 may have the correct solution :^).
    Keith Garner - keithga.wordpress.com

  • WDS capture image on a Windows 2012 R2 server fails with a winload error

    Hello,
    I have been fighting with this problem for days now. I have to install
    30 Win8.1 Pro PC's with  WDS. The WDS service is running on a Win2012 R2
    server. I added the Win 8.1 Pro boot and install images and created a capture image.
    Now when I boot the reference computer I get  a Boot Manager message saying that winload.exe is missing or corrupt. The original boot wim works
    correctly.I removed and added the WDS role a couple of times, I tried the procedure with a 32 bit Win7 boot image, and that worked, But when I added the capture image created from the original Win8.1 boot.wim, that spoiled both capture images.  I tried
    the same thing with a Win2012 R2 Standard server after removing and adding the WDS role again, but the capture image generated the same error as above. .I see that since about mid-April many people has the same problem.Different solutions are suggested, but
    none of them   worked for me.  One of them is to mount and unmount the capture image, that didn't help for me.
    Any help is appreciated.
    Thanks
    Gabor

    Do I understand correctly that if you deploy original wim file to your testPC1 it works all right, but if you deploy an image that you captured on buildPC to testPC1 then you get the winload.exe error ?
     Are you formatting (deleting all the partitions) on testPC1 during the
    deployment of captured image ? Can you check and confirm if the HDD seting for AHCI or IDE (yes, its still around) is the same option on both stations?

  • Administrator account is disable when deploying windows 7 x64 captured image

    I’m using MDT 2012 update 1. I create one deployment share with two task sequence.
    The task sequences are: one for windows 7 x86 and the other one is windows 7 x64.
    Both are working fine until I try to sysprep and capture with all the windows updates.
    Sysprep and capture windows 7 x86 with all windows update work fine. I’m able to deploy the captured image without an error.
    My problem is with the windows 7 x64 captured image. I’m able to sysprep and capture the windows7 x64 with all the windows update. Once the capture is completed, I change the .win file in my windows 7 x64 task sequence to point to the new .win file (capture
    image with all the windows update). When I deploy windows 7 x64 on a pc, the OS get install but boot up to the sign on screen. The Task sequence does not complete. No error message. Cannot log in as local or domain administrator, account is disable.
    Why does it work with my windows 7 x86 image and not with my windows 7 x64 image?
    With my windows 7 x86 image the task sequence completed successfully with no error and it logon automatically in windows but not with my windows 7 x64 image.
    Both task sequences are the same.
    Let me know if any info for this please.
    thanks

    They should both work, perhaps you missed a step when creating the x64 image.
    1. Verify that the Windows 7 x64 image was created cleanly, with no errors. Sysprep ran with no errors.
    2. Verify that you created the windows 7 deployment task sequence cleanly. I would do a windiff of the TS.xml and unattend.xml file from both folders in the deployment share.
    3. Try running without a domain. Some domain's have a GP set to disable the local administrator account.
    Keith Garner - keithga.wordpress.com

  • "Capture encountered a problem reading the data" ANYBODY HAVE AN ANSWER?

    "Capture encountered a problem reading the data on your source tape..."
    How do I get FCP to capture the footage? The tape is fine as far as I know. When I play the tape it shows up in the capture window, but when I click capture "Now", it'll capture 2 seconds, stop, then give the message:
    "Capture encountered a problem reading the data on your source tape. This could be due to a problem with the tape. Capture has been aborted and your clip has been saved."
    Any help would be greatly appreciated.
    Mac OS X (10.4.9) 2 GHz PowerPC G5, 4 GB DDR SDRAM
    Kazinako
    I have a Sony TUV 900, and this camera and this FCP have worked together in harmony for many years until recently. I have no external hard drives, only internal hard drives. The firewire goes out of camera and goes into back of computer. The tape plays fine in my TUV 900 camera, (where the tape was originally recorded.)
    I recently read on this forum where someone said they:
    "Actually, I just had to switch to NTSC in the easy setup menu. I could have sworn I did that last night but I guessed I missed it. Anyway, I can capture now."
    I would appreciate any advice on this subject.
    Thanking you in advance, Michael Kasino

    Try another device-- deck or camera to eliminate that possibility.
    So I did this and now suspect the camera...
    I tried another camera, and I still encountered the problem, (probably because of tape damage at this point), But the ALT camera did a much better job and digitized over areas the TUV 900 could not.
    Now, I agree it is a camera issue. It could be 'bad tensioning' in the cassette, or my tape transport in the camera could be 'slacking the tape'. (I was using a Maxell Minin DV rewinder recently.
    Is this camera even worth repairing, or even able to be repaired? ( $3-500. ?)
    Am I better off getting a newer model at this point?
    Also I am seeing ALOT of 'artifacting', big blocky elements of distorted image to the left side of my screen during and on digitized clips. (Could the head be going south?)
    Any thoughts helpful.
    MK

  • When you save an image, your captured image is bec...

    I realize that when I take a picture picture from my 5800, ALL my saved images become foggy! According to preview (capture) image, preview images are NORMAL!... So I think the problem is about software based, not hardware!  I have V20 firmware .... I hope Nokia may interest about this problem!...Will upcoming 5800's firmware solve this problem?...
    Thanks.
    Nokia 5800 XpressMusic
    v20.0.012

    It always is to start with. Keep the image displayed for a few seconds and while it's up on the screen, the phone will render a sharper version and display it eventually.
    Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!

  • TS3274 If I touch camera icon, the screen turns black instead of capturing image. Let me know how to troubleshoot.

    If I touch camera icon, the screen turns black instead of capturing image. Let me know how to troubleshoot?

    Try closing the Camera app:
    1. Double-click the Home button to reveal the Task Bar
    2. Hold down the Camera app for a second or two until you see the minus sign
    3. Tap the minus sign to close app
    4. Tap area above Task Bar to return to Home screen
    If the above doesn't solve the problem, do a reset:
    Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider

Maybe you are looking for