Skip to main content

Monitoring and Indicating Progress

  • Chapter
  • First Online:
Swing for Jython
  • 889 Accesses

Abstract

As you’ve no doubt seen, many graphical applications include a progress indicator of some sort to convey how quickly something is happening. I don’t know about you, but I tend to be somewhat impatient, so I find these progress bars very helpful. I hate it when a program just sits there—is it still working, has it hung, who knows? This chapter covers some different ways to measure progress and communicate it to your users.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    See http://docs.oracle.com/javase/8/docs/api/java/awt/Cursor.html .

  2. 2.

    See http://docs.oracle.com/javase/8/docs/api/javax/swing/JProgressBar.html .

  3. 3.

    See http://docs.oracle.com/javase/8/docs/api/javax/swing/BorderFactory.html .

  4. 4.

    See http://docs.oracle.com/javase/tutorial/uiswing/components/border.html .

  5. 5.

    See http://docs.oracle.com/javase/8/docs/api/javax/swing/SwingWorker.html .

  6. 6.

    The script containing the “first attempt” is the ProgressBar1.py file found in the code\Chap_18 directory.

  7. 7.

    Yes, there really are two underscores between super and setProgress.

  8. 8.

    Interestingly enough, the JProgressBar Javadoc doesn’t explicitly identify indeterminate as an actual attribute or field. But if you use the classInfo function from Chapter 4, you can see that it does exist and your Jython scripts can access it directly, even though this practice is discouraged.

  9. 9.

    See http://docs.oracle.com/javase/8/docs/api/javax/swing/ProgressMonitor.html .

  10. 10.

    Note that the class name can’t be the same as the Java Swing class you are trying to use.

  11. 11.

    A Java application would need to catch a java.lang.InterruptedException instead.

  12. 12.

    See http://docs.oracle.com/javase/8/docs/api/javax/swing/JOptionPane.html#message .

  13. 13.

    All of these output images were generated by ProgressMonitor4.py. You will have to edit the source script and uncomment the desired assignment statement in the start() method to duplicate these different outputs.

  14. 14.

    See http://docs.oracle.com/javase/8/docs/api/javax/swing/ProgressMonitorInputStream.html .

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Robert A. Gibson

About this chapter

Cite this chapter

Gibson, R.A. (2015). Monitoring and Indicating Progress. In: Swing for Jython. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0817-5_18

Download citation

Publish with us

Policies and ethics