Adding progress Monitor

HI All,
I have been working with reading an XML file through a local path, and sending it to the server via a web service
The code is something like this:-
String strnewpath = vecPathPLS.elementAt(insel).toString();
FileInputStream finpStream = new FileInputStream(strnewpath);
len = finpStream.available();
for(int i=1; i <= len; i++)
                              postxml = postxml+(char)finpStream.read();
//This postxml will be sent as a parameter to the webservice method"post"My problem is I have to add a progress monitor or a progress bar while the file input stream is getting read in postxml.
I dont know how this can be done.
Any help and code snippets from your side will really help me out
Thanks a lot
Shikha

this thread from a couple of days back might help
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=708732

Similar Messages

  • How do I add a progress monitor to a drag and drop question in captivate 7

    I need to build a quiz. We have spent a lot of time on the style guide and appearance but I am having difficulty adding a progress monitor to my drag and drop questions. How can I do this?

    A Drag&Drop is not a normal question slide, hence that progress indicator is not added, and it wouldn't even be functional.
    Long time ago I explained how to create a custom progress indicator, maybe it can help you: Customized Progress Indicator - Captivate blog

  • Progress Monitor OR Progress Bar.........Please help

    I have a JFrame with a menu. As soon as I click the menu I am adding a panel to the JFrame which takes some time. To indicate this to the user should I use the Progress Bar or the progress monitor.
    In either case how do I use it?
    Thanks in advance and it would be very useful if someone could give a small skeleton code.
    Thanks once again

    I am having the same problem which you had with the progress bar.
    I have a DesktopPane with Menu Bar on the top and Internal Frames get added to the DesktoopPane according to the Menu Item selected and the Internal frame takes time to open I want to show the progress bar. I thing you have got the solution by this time.
    Has anybody else have the solution for the above. Basically i want to show the time taken by the classes to load a Internal frame using Progress Bar. Please send me the piece of code. Thanks in Advance.

  • What's wrong with my Progress Monitor and how do I fix it?

    Hello,
    My progress monitor fails to draw its insides, except when the task is already finished
    Inside a class that extends SwingWorker<Void, Void> ...
         @Override
         public Void doInBackground() throws Exception
              try
                   this.progressMonitor = new ProgressMonitor(jPanelControl,
                             "Running a Long Task",
                             "", 0, data.size());
                        //jPanelControl.invalidate();
                        progressMonitor.setMillisToPopup(500);
                        progressMonitor.setMillisToDecideToPopup(100);
                   this.doProcess();
              catch (Throwable e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return null;
         }doProcess goes on a little journey until we get to:
                      progressMonitor.setNote("Importing " + this.title);
            for (int i = start; i < this.data.size(); i++)
                   progressMonitor.setProgress(i);
                            //doing stuff each iterationQuickly after loading begins the box appears but it's not drawing the graphics inside the window (see screenshot for more)          
    btw: That white background is Java3D, could it be interfering with the way Swing updates graphics?
    Edited by: loza on Aug 25, 2009 4:03 AM

    Hi,
    take a look at [this sample from java tutorial|http://java.sun.com/docs/books/tutorial/uiswing/examples/components/ProgressBarDemoProject/src/components/ProgressBarDemo.java] ;
    Regards,
    Alan Mehio
    London,UK

  • Need configure guide for job progress monitor in JSM

    Hello Guys,
    I have received  an requirement to setup job progress monitoring in JSM(job schedule monitor).i have done my search in Google for configuration guide, but i could not find it.
    My Requirement:- i need to monitor the jobs progress(running on manage system) which consists on nearly 10 setps.End user need to monitoring the job progress  using PI diagram.
    Guys  if any one of you have done this setup please help me with configuration setps.
    Please provide your inputs on this.
    Regards,
    Pavan

    Hi Pavan,
    That should have been my place from where I would have start
    I hope Jansi, Prakhar or Karthik can redirect you on this.
    Meanwhile, If I get any thing, I will share it.
    Regards

  • Deployment Progress Monitor

    Once I start the application using "Debug" or "Run", the Deployment Progress Monitor will show the messages:
    "Starting Application" ...
    "asadmin -start-domain ...."
    and then this status window will be kept open even with "Automatically close" set. As result of that, the Web browser is never opened by Creator.
    There isn't any error message in server.log. The server is started and I can open the first page typing the URL. I checked and the path to the default browser is correctly set in the Creator "options" setting.
    There are two problems that result of the above situation:
    1) The browser will not be open with the first page;
    2) Even that I use "Debug" to start the application, I can't debug it, breakpoints will not work;
    Thxs

    Yes, if one starts the app server outside Creator. It will be much more stable and the monitor window will not hang.
    Also, it is good to check doman.xml. Sometimes the application name is not set correctly in context-name.
    Finally, If Creator begins to not be able to start the App Server, one also canjava, javaw, rundll and extra runide process in the Task Manager.
    Thanks.

  • How to use  Progress Monitors?

    how to use Progress Monitors?
    in the name of god
    hi friends
    i have a problem. I am writing a program that read data from a file record by record and store to a database. my problem is here that i want add a progress monitor that when the program is doing its work it appear. I use ProgressMonitorInputStream class but it can not work well. It appear and read file record by record and store in table of database but its progress don’t move and do nothing. I know that I have a tiny problem in use this class. Please guide me.
    i put my codes below.
    best regards
    *////this is an event that invoke my classes*
    private void readbtnActionPerformed(java.awt.event.ActionEvent evt) {                                       
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setCurrentDirectory(fileName);
            //filtering file extension
            FileNameExtensionFilter filter = new FileNameExtensionFilter("Text file", "txt");
            fileChooser.setFileFilter(filter);
            //fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            int result = fileChooser.showOpenDialog(this);
            if (result == JFileChooser.APPROVE_OPTION) {   //if choose ok button
                fileName = fileChooser.getSelectedFile();
                ReadTextFile readFile = new ReadTextFile(fileName);
                readFile.openFile();
                readFile.readRecord();
                *//readFile.closeFile();       //if  this line enable this message appeare "Scanner closed" .why?*      
                readFile.closeFile();
            } else //if choose cancel button
                result = 0;     //do nothing
    */////this is readFile class and invoke data access class and insert data in my database*
    public class ReadTextFile {
        private Scanner input;
        private File fileName;
        private int i = 1;
        DataAccess dal = new DataAccess();                     //new a defined my class
        AcountRecord record = new AcountRecord();
        public ReadTextFile(File n) {       //Constructor
            fileName = new File(String.valueOf(n));
            this.openFile();
        private void setRecord(String val) {
            try {
                record.setId(Integer.parseInt(val.substring(1, 5)));
                record.setTime(Integer.parseInt(val.substring(8, 12)));
                record.setDate(Integer.parseInt(val.substring(15, 21)));
                record.setMode(val.substring(24, 26));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, "ÇäÊÎÇÈ ÔãÇ äÇÏÑÓÊ ÇÓÊ.","Set Record Method",JOptionPane.ERROR_MESSAGE);
        public void openFile() {
            try {
                input = new Scanner(fileName);
            } catch (FileNotFoundException e) {
                JOptionPane.showMessageDialog(null, "ÇäÊÎÇÈ ÔãÇ äÇÏÑÓÊ ÇÓÊ.","Open File Method",JOptionPane.ERROR_MESSAGE);
        public void readRecord() {
            new Thread() {
                private Component _Main;
                @Override
                public void run() {
                    try {
                        input = new Scanner(fileName);
                        InputStream in = new FileInputStream(fileName);
                        ProgressMonitorInputStream pm =
                                new ProgressMonitorInputStream(_Main, "reading the file", in);
                        ProgressMonitor pmo = pm.getProgressMonitor( );
                        pmo.setMaximum( (int) fileName.length());
                        while (/*input.hasNext() &&*/ pm.read() != -1) {
                            setRecord(input.next());
                            dal.Connect();
                            String sql = "INSERT INTO fileinfo(pkey,id,date,time,mode)VALUES(%s,%s,%s,%s,'%s')";
                            sql = String.format(sql, i++, record.getId(), record.getDate(), record.getTime(), record.getMode());
                            dal.doCommand(sql);
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(null, e.getMessage() ," Read Record method.",JOptionPane.ERROR_MESSAGE);
                    dal.Disconnect();      
            }.start();
        public void closeFile() {
            input.close();
    }Edited by: firethumbs on Mar 26, 2009 12:43 PM

    IN THE NAME OF GOD
    hi firends
    i forget say one thing. if remove while loop content this program will work good. i suppose that the while condition and read file records not similar. because while condition check bytes but in while body read records. is that true?
    how can solve this problem?
    best regurds

  • Progress Bar or Progress Monitor for a system command

    Hello,
    I am running a DOS copy command in a Java Swing application. I understand that I
    can implement a Progress Bar or a Progress Monitor if I open the first file, read it,
    and write to a second file. But if I have a need to use the DOS copy command,
    is there a way to implement a Progress Bar or a Progress Monitor for it. If there is,
    could you please point me to some example code?
    Thank you,
    Chris

    Hello Chris,
    you would have to write some native code which peeks or watches the DOS process and its progress. Surely not an easy task. But without that information, how will you set values for the ProgressMonitor?
    What you could do, however, is showing an Indeterminate JProgressBar at DOS process start and make it disappear at process end.

  • Trouble in implementing a progress monitor?

    I need a lot of calculation when I click start button, so, I made a thread using SwingWorker class, this thread is responsible for the calculation. I need a progress monitor to display the progress of the calculation, so, do I need another thread to do it? How can I do it? Any suggestion is great appreciated.
    The following is the schetch of my class.
    // this class do the calculation
    // these stuff is within my button listener
    MyClass my = new MyClass(...);
    my.go();
    // stuff in go() method of MyClass is :
    final SwingWorker worker = new SwingWorker() {
    void construct(){
    // Do calculation
    void finished(){}
    How to add another thread to do progress monitor stuff?

    I assume your concern is about updating JProgressBar's value property from your SwingWorker's thread. Since you're using SwingWorker I assume you know the whole "Swing is not Thread-Safe" drill. If only Sun would specify a few more methods to be thread-safe, like JProgressBar's setValue! After all, isn't the raison d'etre of a progress bar to show how another thread is doing? Oh well, why not use my code, below. You don't need another thread, you only need to access Swing from the EDT, hence my calls to InvokeLater. And in case the progress updates come fast and furious, my code coalesces those events. Enjoy -- Nax.
    class Updater implements Runnable {
         public Updater(JProgressBar jpb) {
              this.jpb = jpb;
         public void run() {
              int v;
              synchronized(this) {
                   queued = false;
                   v = val;
              jpb.setValue(v);
         public void update(int v) {
              boolean go = false;
              synchronized(this) {
                   val = v;
                   if (!queued) {
                        queued = true;
                        go = true;
              if (go)
                   SwingUtilities.invokeLater(this);
         private boolean queued;
         private int val;
         private final JProgressBar jpb;

  • Displaying progress monitor

    Hi there,
    I'm trying to display a progess monitor as a method runs. The problem is, I have no parent frame (I'm simply looking to display this progress monitor on screen by itself - like a JOptionPane message) However, I can't get anything to display:
    //...method code....
    ProgressMonitor progressMonitor = new ProgressMonitor(null,
                                      "Processing Array",
                                      "", 0, array.length);
           for (int i=0; i<array.length; i++){
           // do some processing on array
           progressMonitor.setProgress(i);
    progressMonitor.setProgress(array.length);
    // ...method continues...Am I trying to do the impossible?

    How to Use Progress Monitor:
    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
    Or, maybe the problem is the you need to be using threads:
    http://forum.java.sun.com/thread.jspa?messageID=3375278

  • Adding another monitor

    has anyone added another monitor to your I-MAC? Are there ports/slots in these I-MACs?

    iMacs have a mini dvi port on them, you just need to get the correct cable to connect it your an external monitor.
    The cable would be either the Apple Mini DVI to VGA Adapter:
    http://store.apple.com/us/product/M9320G/A?fnode=MTY1NDA3Ng&mco=MjE0ODQzNQ
    or the Apple Mini-DVI to DVI Adapter:
    http://store.apple.com/us/product/M9321G/B?fnode=MTY1NDA3Ng&mco=MjE0ODQzNg

  • Computer Behaving Strangely After Adding ADC Monitor

    I recently added a 15" ADC monitor to my daughter's quicksilver G4 and ever since the computer has been turning itself on at random times during the day and night. I have zapped the PRAM many times and have even replaced the PRAM battery. I can't end this weird behavior. I have tried swapping video cards - the current one is a Radeon mac pro 9000. The computer is a 733 MHz with 768MB of ram and it's running OS 10.4.10

    The monitor in question does have a remote start button and no we don't have housepets. I've seen it go on all by itself.The connections are all solid and the monitor behaves the same on different computers and with different video cards. A defective button seems a very likely suspect. Before I go drop this monitor in the garbage ( I mean take it to the recycling center) is there a way to replace the button or does this monitor present a non-user friendly environment upon opening. This monitor didn't cost enough to spend a lot of money fixing.......but it is a really pleasant screen to look at.

  • Progress Monitoring

    Hi all,
    I need to set up a ProgressMonitor so to display the progress on the main task of my program. this is pretty complex and goes beyond my program, involving others tools. How can i monitorate it? In the example which i saw, in the tutorial and in the Swing Book, i just saw how to make it goes with a Timer, but it's far from an application task progress..!
    How can i deal with this?
    thank you,
    regards
    marco

    1. Destroying the old dialog box"old dialog box".dispose();
    3. creating the JProgressbar and making it
    indeterminateBetter create JProgressBar object before starting the thread.
    2. Starting the long task
    4. Destroying the JProgressBar
    5. informing the user that the task is completeIn your class, define the SwingWorker as:
        final SwingWorker worker = new SwingWorker() {
            public Object construct() {
                /* start your long task.
                 * Call local method, method from other
                 * class, whatever.
                return new Object();
            public void finished() {
                /* To finish off the long task.
                 * This method is called when the thread
                 * finishes.
                 * This where you destroy your progress bar
                 * and inform user the task is completed.
        };Of course, you'll need another thread to monitor the progress of your task, and increment the value in progress bar.
    As for indeterminate progress bar, you'll need to know some estimate anyway.
    If at all possible to break the long task in blocks/sections, that number can be applied to the progress bar. Otherwise, get an average performance time, and set the maximum with a figure, and slowly increment the progress bar. If it reaches 99% before finish, then I guess you have to wait till the task ends, then display 100%. If finishes quickly, then you can boost the speed of increment (or instantly display 100%).
    Alternatively, if you can determine (dynamically) how long before the end of task while running your task, you can always update your JProgressBar values (you probably aware of this, anyway).
    Hope this helps.

  • Progressive monitor export

    Saw this thread but didn't exactly answer my question.
    I'm exporting video shot in SD 60i to present on an HDTV (720p). What's the best export? I usually do the "DVD Best Quality 90 minute" with Mpegs and Dolby 2.0. Is there any fine tuning I need to do to make it look the best it can?
    Also, anyone know why broadcast SD content looks really good (detail/quality-wise) on HD sets, while the SD content I shoot looks the same as it does on my computer monitor? I've got a friend with an HD set at home and the local stations have HD channels on the cable network, and their SD stuff (shown on the HD channel) looks better than the regular SD channel. Is it because it's digital cable? Or is it that his set is a TV set (interlaced), not a computer monitor like my HDTV at work (720p)?
    Hope this makes sense.
    Thanks,
    Jonathan

    Just use log=<any filename> on the exp command line.
    The log file can be read by a different session.
    If you want to see progress (and cause a performance hit) use the feedback=
    option.
    You really would learn this a lot faster by reading the documentation instead of asking doc questions over and over again.
    Sybrand Bakker
    Senior Oracle DBA

  • Progress monitoring for long operation

    I know that questions similar to this have been asked many times, but I have not gotten an answer that works for me, so here goes. I have a dialog box with various parameters that the user can specify for a long running task. After the user clicks "OK", I want the dialog box to disappear and instead to have an indeterminate jprogressbar display while the task is running. I have tried using SwingWorker classes and invokeLater(), but I ahve not gotten anything to work. Could someebody please help me out with which parts of the code:
    1. Destroying the old dialog box
    2. Starting the long task
    3. creating the JProgressbar and making it indeterminate
    4. Destroying the JProgressBar
    5. informing the user that the task is complete
    need to be performed using a SwingWorker or invokelater and how the parts should fit together.
    Thank you for the help,
    Jeff

    1. Destroying the old dialog box"old dialog box".dispose();
    3. creating the JProgressbar and making it
    indeterminateBetter create JProgressBar object before starting the thread.
    2. Starting the long task
    4. Destroying the JProgressBar
    5. informing the user that the task is completeIn your class, define the SwingWorker as:
        final SwingWorker worker = new SwingWorker() {
            public Object construct() {
                /* start your long task.
                 * Call local method, method from other
                 * class, whatever.
                return new Object();
            public void finished() {
                /* To finish off the long task.
                 * This method is called when the thread
                 * finishes.
                 * This where you destroy your progress bar
                 * and inform user the task is completed.
        };Of course, you'll need another thread to monitor the progress of your task, and increment the value in progress bar.
    As for indeterminate progress bar, you'll need to know some estimate anyway.
    If at all possible to break the long task in blocks/sections, that number can be applied to the progress bar. Otherwise, get an average performance time, and set the maximum with a figure, and slowly increment the progress bar. If it reaches 99% before finish, then I guess you have to wait till the task ends, then display 100%. If finishes quickly, then you can boost the speed of increment (or instantly display 100%).
    Alternatively, if you can determine (dynamically) how long before the end of task while running your task, you can always update your JProgressBar values (you probably aware of this, anyway).
    Hope this helps.

Maybe you are looking for

  • How can we copy personalization from one to an othere resp/function

    guys, As we use people and maintain function to maintain employee information, in this function we have made personalization and working fine, but after restricting function which is appearing on others button like (absence, qualification, previous e

  • PS subcontracting with external activity

    Hi, I have a couple of questions about "PS subcontracting with external activity" I have not found any information about this for PS subcon flow, I was looking for a subcon PS Wiki but no succeed. The scenario is to use a  external activity to a subc

  • Applying Color to Font

    I wrote a formula that gives colors according to the condition in the Group Header. Now I want the Font Color of those in the Group Footer  to be exaclty same to that in the Group Header  . Is there any way to do it. PS: In the Grou Header the formau

  • Printing hang X-Rip 1.7 OSX 10.6.8 (fix?)

    Trying to print from the Demo of X-Rip 1.7 to HP Designjet 430 from Vectorworks 2008 and it will print the first page fine then not print a second page from the print queue, although it says the first print is complete. X-Rip site says to do Easy Ins

  • Airport setting up the location for find my ipohne

    i want to set up the location so that i can use the find my iphone and have it show up on a map displaying where it is