Monitoring progress of URLs - How?

I'm developing a very simple web-browser, and I would quite like to have a progress bar to display how much of the current page is loaded.
I have been trying to use a ProgressMonitorInputStream to get a dialog with a progress monitor to appear, but with no success. The code I'm using is:
ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(null, "Current Status",
url.openConnection().getInputStream());
ProgressMonitor pm = pmis.getProgressMonitor();
pm.setProgress(0);
pm.setMillisToDecideToPopup(100);
html.setPage(url);
where "html" is a JEditorPane and url is an URL object for the page I'm downloading.
Am I going about this the wrong way? Any pointers would be greatly appreciated.

Unfortunately you need something a like more complex since your current code is opening up the stream ok and wrapping it in the progress monitor but then when you pass the URL to JEditorPane it is then opening the stream itself and bypassing your monitor.
You need to create a sub-class of JEditorPane and override the method: getStream to return an InputStream that is wrapped in a ProgressMonitorInputStream and probably a BufferedInputStream as well...
You could even just do:
protected InputStream getStream (URL page)
throws IOException
     InputStream in = super.getStream (page);
    ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(null, "Current Status", in);
    ProgressMonitor pm = pmis.getProgressMonitor();
    pm.setProgress(0);
    pm.setMillisToDecideToPopup(100);
    return new BufferedInputStream (pmis);
}That might work but no promises...

Similar Messages

  • Monitoring Progress of Loading an Application

    How do I Monitor progress of loading an application made in Java itself using Progressbar or ProgressMonitor?

    Hello Bharat,
    I think programming the ProgressBar is not the main problem, but having it
    displayed as soon as possible after launching the application. I at least
    have no idea how to guess/calculate the loading time. But to have an indeterminated ProgessBar quickly showing would already be nice.
    Joerg

  • Every single time I power up photoshop CC get an error. says " the monitor profile "acer S201HL" appears to be defective. Please rerun your monitor calibration software. How do I fix this?

    Every single time I power up photoshop CC get an error. says " the monitor profile "acer S201HL" appears to be defective. Please rerun your monitor calibration software. How do I fix this?

    Your factory-supplied monitor profile, associated with your monitor by the operating system, is bad.  It's more common than you'd think.
    To avert the error:
    Open the Color Management panel of your Windows operating system.  In the Devices tab, if it is not already listed [ Add... ] the sRGB IEC61966-2.1 profile and [ Set as default Profile ].
    After doing the above, log out of Windows and back in again, just to ensure everything's updated.
    Note that the above assumes your monitor is more or less displaying color in the sRGB color space (sRGB is short for sRGB IEC61966-2.1).  For many monitors this isn't a terribly wrong assumption.
    If you want to ensure you have the most accurate color, consider buying a calibration and profiling device, which (with its associated software) can set your calibration and generate custom color profiles by doing actual measurements from your monitor.  You'll want to take some time to get your mind around how color-management works, and that is not a trivial task.  It's certainly well beyond what can be taught in a forum post by post.
    Good luck.
    -Noel

  • How to monitor progress of web-service calculation?  And abort it?

    Hello. We're thinking of converting an existing Java radar calculation program into a web-service, so that it can be used by various interested parties. However, calculations can take some time (several minutes) and so we would like the client to be able to both show calculation progress and allow the user to abort the calculation if necessary. It is not obvious to us how to do this with a web-service. Are there any standard approaches to this problem? What's the best way of a client asking the web-service how a calculation is progressing? What's the best way for a client to abort a calculation? Any advice most welcomed.
    Kind regards
    Paul Howland
    NATO C3 Agency
    The Hague

    You can't estimate the duration withour running the gather_database_stats. You can monitor it while it is running. (e.g. count the tables that have got updated statistics based on DBA_TABLES)
    And if you run gather_database_stats, the default behaviour might well be to exclude tables which aren't "stale" while in the imported database the expectation is to gather stats on all tables.
    (Similarly, the behaviour to gather column histograms (method_opt) may differ in an existing database from a newly imported database)
    Hemant K Chitale
    Edited by: Hemant K Chitale on May 14, 2013 10:13 AM

  • SCOM 2012 R2 - How to create a Web Application Monitor for an URL requiring certificate authentication

    Hi All,
    It looks like in SCOM 2012 there are two ways to monitor a web application (URL monitoring):
    Way no 1: (Using the Web Application Transaction Monitoring template)
    Way no 2: (Using the Web
    Application Availability Monitoring template)
    We have created some monitors using
    Web Application Availability Monitoring to check if URL is up without any authentication method.
    However, we have few URLs for which we need Client Certificates to be used for accessing them but found no option in SCOM 2012 to configured the certificates. 
    I have searched a lot on the Tech Net library but no clue.  Does anyone know how to successfully monitor an URL requiring certificate authentication on SCOM 2012 ? or, at least, using no matter which method?
    Thanks.
    Regards,
    Raju.

    Hi,
    Based on my research, it is not possible by using the built-in monitoring templates. Both of them handles “normal”, server-side, SSL-certs, and the transaction monitor handles basic/digest/NTLM authentication, but client certificate based authentication
    is not a configurable option.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • SHRINK SPACE - How do you monitor progress?

    Does anyone know how to monitor the progress of a SHRINK SPACE command ?
    Session_Longops view shows nothing for that SID.

    you may customize the columns selected or the filters of the below query and monitor who is doing what, and if necessary you may start event 10046 level 8 trace - http://tonguc.wordpress.com/2006/12/30/introduction-to-oracle-trace-utulity-and-understanding-the-fundamental-performance-equation/
    SELECT sq.sql_text,
           se.status,
           se.username,
           se.osuser,
           se.terminal,
           se.machine,
           'ALTER SYSTEM KILL SESSION ''' || se.sid || ', ' || se.serial# ||
           ''' IMMEDIATE ;',
           se.sid,
           se.serial#,
           pr.spid,
           se.saddr,
           se.schemaname,
           se.program,
           se.logon_time,
           sq.hash_value,
           sq.address,
           sq.buffer_gets,
           sq.disk_reads,
           sq.executions,
           sq.fetches,
           sq.rows_processed,
           io.block_gets,
           io.consistent_gets,
           io.physical_reads,
           io.block_changes,
           io.consistent_changes,
           se.module,
           se.action,
           se.client_info,
           sw.event,
           sw.p1text,
           sw.p1,
           sw.p2text,
           sw.p2,
           pr.pga_used_mem,
           pr.pga_alloc_mem,
           pr.pga_freeable_mem,
           pr.pga_max_mem,
           'exec dbms_support.start_trace_in_session(' || se.sid || ', ' || se.serial# || ', ' ||
           'waits => TRUE' || ', ' || 'binds => TRUE);',
           'exec dbms_support.stop_trace_in_session(' || se.sid || ', ' || se.serial# || ');'
      FROM v$session se, v$sqlarea sq, v$process pr, v$session_wait sw, v$sess_io io
    WHERE status IN ('ACTIVE', 'KILLED', ' INACTIVE', ' CACHED', ' SNIPED')
       AND TYPE = 'USER'
       AND se.sql_hash_value = sq.hash_value(+)
       AND se.sql_address = sq.address(+)
       AND se.paddr = pr.addr
       AND se.sid = sw.sid
       AND se.sid = io.sid
    ORDER BY sq.sql_text, se.username, se.schemaname, se.osuser, se.program, se.sid

  • How to monitor (progress bar) a DB request ?

    Hi,
    I developped an application that requests a sybase database.
    I would like to monitor (for instance with a progress bar) the time a request takes, in order to inform the user of the application.
    Does someone have an idea ?
    Thanks in advance, Fred.

    As long as you cannot break down the request into several pieces (an execute them separately), there is probably no way to do this.

  • Computer Monitor Progressive vs. HD progressive

    OK, so we all know that if a project is going to be broadcast, you have an NTSC monitor set up when you're editing, right? Because the computer monitor is a progressive display, it isn't the best when it comes to color correction or interlacing/deinterlacing issues (as seen in many a thread here when people say "XXXX looks really bad when I see it in the canvas" only to have someone say "Have you looked at it on a TV or NTSC monitor?). So we're all in agreeance (is that even a word?) that computer monitors (LCDs like the Apple's Cinema Display) are not the best to view this stuff, right?
    That said, how come all HD televisions (smaller than 52 inch plasmas) are LCD progressive? Isn't that just like watching something on a computer monitor?
    Just wondering.
    Jonathan

    Progressive plasma and LCD TV's have powerful de-interlacers built into them, they effectively take the 480i60 image and upscale, and interpolate it into a 480p60 image, in real-time, there is a delay in the picture because of this, and the sound has to be delayed to match - it is quite noticeable when playing rhythm action games on consoles (like Guitar Hero).
    Some do it better than others, and some don't do it at all (discard 1 field to make a 240p30 image, and blend).
    The same is true of 1080i60 images being turned into 720p60 or 1080p60 by HDTV's, again, some do it badly, or not at all.
    What I do on a computer, is use compressor to take i60 sequences and use the advanced format conversion to set the frame controls up to create a p60 sequence, for viewing on a monitor. It takes a long time to do, but looks pretty decent, and still maintains the fluid movement I expect from video (60 updates per second).
    For instance, taking 1080i60 HDV and making 720p60 DVCProHD seems to work quite well.

  • JProgressBar - monitoring progress of a method in another Object.

    Hi all,
    I've been three days trying to make a JProgressBar work. I know how to use them but not in this case. I'll try to explain the code instead of making you read it.
    -I have a JProgressBar in a JDialog.
    -In the constructor of this class I create a new instance of a Object, call it Processor for example, and i run a method start() on it.
    -This method execute a number of SQL statment and i want to monitor them in the JProgressBar.
    I've followed the official tutorial but it doesnt work for me, I have no idea how to do it beacause i don't know how to refresh the Task process property from outside the doInBackgroundMethod. I also tried to create 2 SwingWorker, run the Processor.run() in one of them, an in run() update a "satic int progress" in each iteration, then from the other SwingWorker i check the Procesor.progress to invoke the setProgress() method.
    I have realised that when debugging sometime it works, so i supposed is something about concurrency, I don't know, please help.
    Thank you in advanced.

    the processor is a runnable, right? then:
    MyDialog extends JDialog{
    private final JProgressBar progressBar= new JProgressBar()
    MyDialog(){...}
    private void init(){
    new SwingWorker<Void,Object>(){
    public Void doInBackground(){
    String sql1=...
    Object o = execute sql1
    publish(o);
    ... do the same with other sql queries
    return null;
    public void process(List<Object> chunks){
    //update progressbar
    //this method will be called using coalescence, so maybe you execute 3 queries, and this method gets called just once, and in this case 'chunks.size()==3'
    public void done(){
    //make sure that the progress is complete, the last chunks may have not been processed through process() method
    progressBar.setValue(100%) // I dont remember the syntax for this
    Edited by: thrawnkb on Jun 3, 2009 3:36 PM

  • Monitor progress of through WebService DataHandler

    Im trying again as my first post in the glassfish forums have not lead to any help/suggestions. I def dont like to repost but I need to expand my audience a bit.
    I am building a web service to move files around. I am using a method that returns a @XmlMimeType("application/octet-stream") DataHandler to the client. I do have @MTOM and @StreamingAttachment enabled. S
    I dont really know the details, but the call to the WebService that returns the DataHandler seems to actually move the file over? After the method returns, I get the DataHandler and any moving of the data on the client side takes no time at all. So if I call the service to move a 20MB file, the webservice call takes a few minutes, but after the call returns, moving the file through the dataHandler takes not time at all. Any ideas how to monitor this progress on the web service method call? Is there another way to monitor this? TIA.

    Well I'm going to chalk my lack of feedback as a question that is hard to understand from my explanation,or I'm asking the wrong question. But I still believe I cannot be the only one hitting this problem. Simply put I cannot find away to view/handle the progress of a file transferred from a web service to the stand alone client, if that web service call returns a DataHandler. Now in this thread ... [http://forums.java.net/jive/thread.jspa?threadID=22481]
    others have shown how monitor an upload to the server from the client side. I am after the opposite, ability to monitor the progress of file downloading from the server(GF v2.1) to the client.
    Now, is it possible that there isn't a direct way of doing this. Surely Im not the only one to run into this type of situation. Is there a better way of moving a file from glassfish server, with ssl, to a user allowing the client app to monitor the progress?

  • Monitor progress of the query

    I ran an explain on a SQL and it shows the cost of the query to be 20k, but when I run the query it goes on running forever (I killed it after 30mins). I have another SQL whose cost shows up to same 20K and it completes in 10secs.
    I ran a trace on it and it shows its doing tons of IOs and there are many db sequential waits.
    1. What could be the reason for the query1 to run for so long when the cost is not high.
    2. Is there any way to identify which step a query is currently running, I mean how to identify which step of the explain is the query running now? I want to know what part of the query is the database running currently.
    3. I don't see any thing in the v$session_longops for this sql, where do I monitor the progress of this run.
    4. Is there a way or tool which will give me the list of all the tables a particular query is using. There are views used in the queries, which in turn are built on top of other views. So I want to find the list of all the tables for a given query, so that I can find if the stats are outdated for any one of them which might be causing the query to run forever.
    Please help....
    Thanks

    907426 wrote:
    1. What could be the reason for the query1 to run for so long when the cost is not high.That's why it's generally advisable to ignore the cost that shows up in a query plan. It is much more important to focus on the cardinality because that allows you to compare whether the optimizer's estimate of the number of rows that are returned at each step is accurate. If the optimizer estimates the cardinality incorrectly, whether its estimates are high or low, it is likely to pick a plan that will perform poorly.
    2. Is there any way to identify which step a query is currently running, I mean how to identify which step of the explain is the query running now? I want to know what part of the query is the database running currently.What version of Oracle are you using? What edition?
    3. I don't see any thing in the v$session_longops for this sql, where do I monitor the progress of this run.Are there long-running operations in the query plan (i.e. table scans)? Or is it doing a large number of short operations (i.e. nested loop joins that use indexes)?
    4. Is there a way or tool which will give me the list of all the tables a particular query is using. There are views used in the queries, which in turn are built on top of other views. So I want to find the list of all the tables for a given query, so that I can find if the stats are outdated for any one of them which might be causing the query to run forever.The query plan should tell you every object (table or index) that will be accessed.
    Justin

  • Secondary monitor on 20"iMac, How to set portrait orientation when running

    How do you set the display rotation in Windows XP?
    I have a secondary monitor (wall-mounted at 90 degrees to normal) that OS X handles just fine (the display preference window provides a rotate function). However, when running Windows XP, the secondary monitor is still available, but I can not find a setting that will rotate the display. I downloaded the Apple Boot Camp ATI driver from AMD's site and the driver version went from 8.39 to 8.43. Still no visible way to rotate the secondary display. I then upgraded Boot Camp to 2.1 after which the ATI driver version went to 8.45. Still no rotate functionality.
    I have tried using the ALT-OPTION-ARROW key with no success (recommended on some obscure Windows XP forum). I also downloaded the Apple Boot Camp Crystal Control Center from the AMD site, but it would not execute after installation (this upon yet another obscure recommendation).
    I also have Windows XP on my MacBook. It uses an NVIDIA driver and it will allow display rotation.
    Any help or advice is appreciated.

    Updating my original post:
    I have resolved the issue. The ATI Catalyst Control Center app (I meant Catalyst, not Crystal in my original post) needs Microsoft's .NET Framework 2.0, which was not included in my original Windows XP installation.
    After downloading and installing the .NET Framework 2.0 package and reinstalling the Catalyst Control Center app, I am now able to rotate the secondary monitor display to the portrait orientation.
    I use the secondary monitor primarily viewing on-line documentation while working with an application on the primary screen. The portrait orientation provides a much better environment for reading documentation as I can view 2+ pages at the same time.

  • I have a diabetes monitor free style insulinx how do i get it to work on the MAC lion version

    Hi Can anyone help.
    I Have a diabetes monitor free style insulinx but it does not work on the lion operating system. Has anyone managed to get this to work.
    Initially it started to load the application but then stopped and would not work.
    Any ideas, I am reliably informed that it use to work on the leopard and snow leopard operating system.
    Apple are you able to assist.
    I have spoken to insulinx but they state it will have to come from Apple and if and when insulinx find a fix they will let me know, but who knows how long that will be.
    any advice would be welcome.
    thanks
    wwnw

    I had the same problem and called Abbott with no luck.
    But I found a way, there is a new version 1.2 out there that works but it cannot be installed directly on Lion.
    You need access to a Leapard or Snow Leapard computer.
    1. Install on Lion (I know it installs but it does not work)
    2. Install from your meter on  and update the software from there to 1.2
    3. Copy the installation folder from the application folder of Leapard to Lion Application folder
    4. Launch the app and it will see your meter.
    Good luck.

  • Powerbook monitor died...how do i recover files?

    I have a powerbook titanium and the monitor has died. It would cost like 400$ to replace the monitor so i bought a new macbook. how would i go about getting my data in the harddrive out? I was thinking two solutions
    1) remove hardrdive put it in a ide 2.5 inch enclosure connect it to a laptop?
    2) plug it into a external monitor hit the hot key to switch to external monitor and retrive data from there
    which would work best? i am new to mac.s also can i buy a used powerbook off ebay that has a working lcd and replace it myself ?
    Thanks

    Hi kkokko,
    I don't run Tiger, but thought I'd heard it had a migration assistant which automatically ran when you first start up the new PB to transfer data from earlier Mac to newer Mac? Need a FW cable, but not sure if you need to connect it first or it'll ask you to do it when you set up the new MB.
    Last FW cable I bought was about $12; if you google for it, you should find one for well under $20 US.

  • PC & Mac Sharing 1 Monitor and KB Setup - How to use KB/Mouse for both?

    I am purchasing a Mac Mini to replace my personal computer. I have one monitor/KB/mouse setup shared between my work and personal PC, switched back and forth via a USB KVM switch (http://www.iogear.com/product/GCS632U/)
    I want to go with the Apple bluetooth mouse and keyboard with the purchase of my mac mini, but how can I make it so it will work with both my work PC (Windows XP Dell laptop docked) and my new mac mini?
    Should I purchase a USB bluetooth dongle and connect that to the mini KVM switch? Or should I just plug the USB dongle into my docked laptop and pair with both the mini and the PC (if pairing to both is even possible)?
    Thanks in advance.

    If both are on your intranet, try Synergy.
    I personally use the Wormhole.  You can drag between desktops.

Maybe you are looking for