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

Similar Messages

  • 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;

  • HT3382 Connect from a MacBook Pro's mini display port to a Display Port monitor?

    Hello everyone,
    Is it possible to connect from a MacBook Pro's mini display port to a Display Port monitor with resolutions higher than 1920 x 1200? It seems Apple does not supply a mini-DP to DP adapter.
    However, just as they do not make a mini-DP to HDMI adapter, but they do recommend a Belkin product for this purpose.
    Is there any reason that a mini-DP to DP adapter or cable wouldn't work and support high resolutions?
    Thanks for your feedback!

    danz0r wrote:
    Hey tjk,
    Thanks for the response.
    Do you have any recommendations for a potential set up? The audio output and Apple DVI are on different sides of my MBP, which is alright, I guess I can get two long cables to handle each. I was hoping to just have my MBP closer to where I use it, with a cord nearby plugged in on one side to the HDTV and resting near where I keep my MBP for when I want to use the HDTV as an external monitor.
    With a converter like this, you can run video out of the MBP's DVI port, and miniToslink (optical) audio out of the 3.5mm stereo mini jack to the converter, then it will combine the two and output audio and video through HDMI to the monitor.
    http://www.supermediastore.com/product/u/apogee-dvi-to-hdmi-converter-spdif-opti cal-toslink-coaxial-input-output?utm_source=cj&utm_medium=aff&utm_content=HDMI+A ccessories
    Otherwise, depending on the TV's inputs, for video you could run DVI to DVI on the TV, or DVI to HDMI to the TV. For audio you could run 3.5mm stereo mini plug from the MBP to RCA adapter on the TV. Toslink/optical is also an option.

  • Daisy chain two display port monitors (Dell U2913WM) to new Mac mini Thunderbolt?

    Everything I read said that I could hook up a display port monitor to a Thunderbolt port on the mac mini.  I purchased two display port monitors (Dell U2913WM) that can be daisy chained, and hooked them up.  All I get is mirroring.  Does anyone know how to turn off mirroring with this setup?  I did not get the "uncheck mirroring" option in preferences until I hooked up the second via the HDMI port instead of a daisy chain.  The problem with that is, I cannot take advantage of the full resolution through the HDMI.  It seems I have wasted my money on two monitors.
    Looking for advice on:
    1) How to daisy chain these two Dell monitors to the mac mini and turn off mirroring and use an extended desktop, or
    2) How to take advantage of the full resolution through HDMI port?
    Any help would be greatly appreciated.
    Thanks!

    So re-reading this thread, I now realize you did exactly what I wanted to do but your issue was having a cloned vs. extended desktop. Oops!
    I believe your "nothing plugged in" issue is the cable. I'm not sure that TB cables are backwards compatible with DP - I think it's only the ports. Do you see multiple monitors in "System Preferences > Displays" if you hook the monitors up like you described in your OP?
    My Dell U2713H arrived today and it works like a charm with the supplied Mini-DP to DP cable. The built-in display on my 13" mid 2009 MBP still works if not in clamshell mode, although I will mostly use mine in my HengeDock. In the OSD of the monitor, you can access "Display Settings > Display Info" and it will show you the DP capability. Mine is only DP 1.1a and I believe to run 2 of these at full resolution you will need the bandwidth in DP 1.2 which includes MST (daisy-chaining). This could be your problem.
    Can you access the same menu in your OSD and report back what your DP compatability is?
    Thanks!
    mgb

  • 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

  • A1081 Cinema Display LCD Monitor compatibility

    I am about to buy a reconditioned A1081 Cinema Display LCD Monitor 20"? But i need to know if it will work with my MacBook Pro 10.5.8 and my ipad 2? As i am buying it to use at an exhibition. iIf so what adaptor will i need to hook both of these up? Thank you in advance.

    Are you sure the monitor is set to receive input over the VGA input? Have you tried the DVI input on the monitor? You may have better luck with DVI.

  • Video input/ iMac display as monitor

    Hello everybody,
    I have got a feature request for future releases of the iMac series. I think I would not be the only one appreciating a solution to use an iMac's display as monitor for other computing devices such as the Mac mini or older PC-hardware. In my opinion this video input would not have to be more than another little port at the back of an iMac. This could be solved with a mini-port like it is now with the mini-DVI.
    When trying to find a way to use my iMac that way I only found this vnc solution which requires a network connection between both devices but I also found many posts asking for a solution like my proposal.
    Please let me know what you think of it! Thanks in advance!

    It's not that easy. Providing a direct input to the monitor would require quite a bit of additional circuitry. I think that the cost of providing such in input would be unjustifiable when considering the small percentage of iMac buyers who would use such a feature. But you can suggest it to Apple here:
    http://www.apple.com/feedback/imac.html
    For a workaround, perhaps Screen Recycler would work for you.

  • 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

  • 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

  • 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 do I display external monitor as sole display, rather than mirroring, with lid open?

    How do I display external monitor as sole display, rather than mirroring, with lid open?

    sudo nvram boot-args="iog=0x0"   restart to take effect

  • 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

  • Display Progress Indicator in the Run Time

    Hi All,
    How do display Progress Indicator in the Run Time for a JSF Page using ADF components?
    Regards
    Santosh

    I have similar problem.
    Basically my page do search in the database which takes some time. so when search starts I would like to display the progress indicator or some thing which will show some processging is going on in background. Once it completes the background processing, the same page displays the result. At this time I want to hide the progress indicator.
    Is there any way to do this. I am using EA17 with JDev.

  • 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.

  • Cons Group & Unit Display in Monitor

    With the upgrade to EP3 the cons groups and units name displayed in the monitor are the short description instead of the long description as was previously the case.
    It would be most appreciated if you would please suggest ways to change the names display from the short description to the long description.

    HI Dan,
    The display in Monitor works on standard future, and there is no customization involed in that as of now to display wither Short or Long description.
    Else, you can keep the short description as same as Long description, I know this may not solve your problem if the length of Long Description is grater than short.
    Also try contacting OSS help...
    or in R/3 normally if we want any changes in the standard display, we will do the by copying the standard and make changes.  So try using ABAP help, creating Own transaction code by copying the standard "UCMON" and apply necessary changes.
    Give this as last preference, as this includes only technical work.

Maybe you are looking for

  • How to dynamically change the table name for a update statement

    Hi All, I need to update a coulumn xyz in either of tables abc and efg based on some condition. I wrote a cursor which has union of two queries(one querying abc and other efg) Now based on some inparameter only one will be executed at a time. And bas

  • MM Audits - What to report on to ensure total stock optimisation

    Evening, wondering if you guys can help out here. I have recently started a new position (Inventory Controller in Oil and Gas Industry) and i am only just beginning to understand the MM module in SAP. I have been involved in the RLM module in the pas

  • IPSec Spoof Detected error on VPN route

    I'm trying to set up a new VPN user/group/policy to replace a flawed old version that used IP addresses from the same pool as the inside VLAN. As of right now I have most things configured but am unable to establish a connection to a service host on

  • Configure Framework services failed while upgrading to 11.1.2.2

    Hello Gurus, Trying to upgrade Hyperion 11.1.1.3 to 11.1.2.2 and following Oracle's recommended strategy as per install document (Chapter 6 - Upgrading EPM System Products). I have replicated the SQL Server DB to a new server and so far I have succes

  • Oracle 10g Infrastructure database unavailable alert message!!!

    Dear All, I have installed Oracle 10g AS on A machine & Oracle 10g Infrastructure on B machine both are in sync form means Middle-tier A machine configured with Infrastructure B machine well i am facing a problem for few days that in a day 4 or 5 tim