How to use a progress bar?
Hello to everyone, i am trying to put a progressbar in my application, the progress bar i use is the one that appears in the Swing Component part of JBuilder, i have the next code:
JProgressBar progBar=new JProgressBar();
progBar.setMinimun(10);
when i compile the code the next error occurs:
incorrect method declaration; the return type is missing.
I have looked at the Jbuilder help but the code i find is the same as mine, and in other samples too.
show some more codes....it willl surely help...i just hope the error didn't originate from the minimum() method because it was misspelled...
Similar Messages
-
How to use a progress bar with java mail?
Hi, i'm new here.
I want if someone can recommend me how to show a progress bar with java mail.
Because, i send a message but the screen freeze, and the progress bar never appear, after the send progress finish.
ThanksSo why would the code we post be any different than the code in the tutorial? Why do you think our code would be easier to understand? The tutorial contains explanations about the code.
Did you download the code and execute it? Did it work? Then customize the code to suit your situation. We can't give you the code because we don't know exactly what you are attempting to do. We don't know how you have changed to demo code so that it no longer works. Its up to you to compare your code with the demo code to see what the difference is. -
How To Use Microsoft Progress Bar import in ocx in forms6i
I import microsoft progress bar in ocx in form6i but i dont have to initialize it
with form or cursor..
can any one send sample code on [email protected]
thanxxshow some more codes....it willl surely help...i just hope the error didn't originate from the minimum() method because it was misspelled...
-
How can I use a progress bar in objective c mac
How can I use a progress bar in objective c mac? I have a code that downloads a file and I want to be able to let the progress bar increase by 1. A bit further on the code (to download the file) it needs to increase again. And so on...
My code
-(IBAction) downloadButtonPressed:(id)sender;{
//get the path to the image that we're going to download
NSURL *url = [NSURL URLWithString:@"https://www.dropbox.com/s/l6o07m48npxknt4/Cluedo.zip?dl=1"];
//get the path to documents folder where we're going to save our image
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *DocumentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [DocumentsDirectory stringByAppendingPathComponent:@"Cluedo.zip"];
//Download the file to memory
NSData *data = [NSData dataWithContentsOfURL:url];
NSError *error = nil;
//Save it on the Documents directory
[data writeToFile:filePath options:NSDataWritingAtomic error:&error];
NSFileManager* fm = [NSFileManager defaultManager];
NSString* zipPath = filePath;
NSString* targetFolder = @"/Applications"; //this it the parent folder
//where your zip's content
//goes to (must exist)
//create a new empty folder (unzipping will fail if any
//of the payload files already exist at the target location)
[fm createDirectoryAtPath:targetFolder withIntermediateDirectories:NO
attributes:nil error:NULL];
//now create a unzip-task
NSArray *arguments = [NSArray arrayWithObject:zipPath];
NSTask *unzipTask = [[NSTask alloc] init];
[unzipTask setLaunchPath:@"/usr/bin/unzip"];
[unzipTask setCurrentDirectoryPath:targetFolder];
[unzipTask setArguments:arguments];
[unzipTask launch];
//[unzipTask waitUntilExit]; //remove this to start the task concurrentlyYour code really isn't suitable for a progress bar, not a real one anyway. Your code will spend about 99.9% of its time in the method "dataWithContentsOfURL:url". That is not a method you want to use in the real world. It is only for demos or proof of concept exercises. All network operations should be asynchronous. That gives you the ability to gracefully recover when there is a failure and also to do fancy things like display a progress bar and tell the user when the download is complete.
Once you get the asynchronous download logic working, then you can worry about the progress bar. The first thing you will need is the size of the file. Without that, all you can ever do is an indeterminate progress bar or spinner. If you have the size of the file, then you can keep track of how much of the file you have downloaded and update your progress bar with the percentage complete. Make sure to throttle it to no more than incrementing by 1% at a time. Otherwise, a large file or a file transferred in many small chunks, would waste too much time updating the progress bar for no change. -
Seeking in videos using the progress bar
Ever since the 2.0 update, seeking using the progress bar seems very sluggish, far from the smooth experience I had using the 1.1.4 firmware. The playback seems to snap to certain points and fast forward to the point I seek to. I updated to 2.0.1 today hoping this issue would be fixed, but not yet. Anybody else experiencing this?
mine is even worse, after the 2.0.1, video playback is broken. There is no video!!!! but there is audio. This apply to any online video as well like youtube. any facing the same problem? How can i restore to 2.0?
wan -
Is there a way to use a progress bar with Xerces XML Parser?
My program is parsing very long XML files that take several minutes to parse. I am using Xerces as the parser. I would like to use a progress bar to show the progress, but I haven't found any way to get Xerces to give progress updates. Is this possible?
Use teh SAX parser and listen to SAX events. Example:
import java.io.*;
import java.util.*;
//jaxp-api.jar:
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
//sax.jar:
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import mine.IOUtils;
* Handler to read content from (large) XML sources and send events to registered XMLListeners. Use this class to read
* big (multiple megabytes) XML files via SAX and listen to XML events to process XML elements.
* For small (less than a megabyte) XML files, it's more convenient to use the DOM API
* to read the XML into a DOM document and perform XPath commands. DOM is easier to handle but has
* the drawback that the complete XML content is stored in one big DOM document object in memory.
public final class XMLHandler extends DefaultHandler {
/** (Reusable) XMLReader to parse an XML document. */
private XMLReader xmlReader = null;
/** Registered XMLEventListeners. */
private List<XMLListener> listeners = new ArrayList<XMLListener>();
/** Value of current element. */
private StringBuilder elementValue = null;
/** Stack of current element and all of its parent elements. */
private Stack<String> elementStack = new Stack<String>();
* Constructor.
* @throws Exception
public XMLHandler() throws Exception {
super();
// Create a JAXP SAXParserFactory and configure it
final SAXParserFactory spf = SAXParserFactory.newInstance(); //Use the default (non-validating) parser
spf.setValidating(true);
// Create a JAXP SAXParser
final SAXParser saxParser = spf.newSAXParser();
// Get the encapsulated SAX XMLReader
xmlReader = saxParser.getXMLReader();
xmlReader.setContentHandler(this);
xmlReader.setDTDHandler(this);
xmlReader.setEntityResolver(this);
xmlReader.setErrorHandler(this);
}//XMLHandler()
* Add XMLListener to receive XML events from the current XML document.
* If <i>listener</i> is null, no exception is thrown and no action is performed.
* @param listener XMLListener to add.
public void addXMLEventListener(final XMLListener listener) {
if (listener != null) {
listeners.add(listener);
}//addXMLEventListener()
* Parse current XML document. Registered XMLEventListeners will receive events during parsing.
* @param fileName Name of file to read XML content from.
* @throws Exception
public void parse(final String fileName) throws Exception {
if (fileName != null) {
parse(IOUtils.openInputStream(fileName));
}//readXML()
* Parse current XML document. Registered XMLEventListeners will receive events during parsing.
* @param inputStream InputStream to read XML content from.
* @throws Exception
public void parse(final InputStream inputStream) throws Exception {
if (inputStream != null) {
xmlReader.parse(new InputSource(inputStream));
}//readXML()
* Overwrite super.
* Receive notification of the beginning of the document.
@Override
public void startDocument() {
for (XMLListener l : listeners) {
l.documentStarted();
}//startDocument()
* Overwrites super.
* Receive notification of the start of an element.
@Override
public void startElement(final String uri, final String localName, final String qName, final Attributes atts) {
elementStack.push(qName);
for (XMLListener l : listeners) {
l.elementStarted(qName, elementStack);
elementValue = new StringBuilder(); //element value
//element attributes:
if (atts.getLength() > 0) {
String attName = null;
for (int i = 0; i < atts.getLength(); i++) {
attName = atts.getQName(i);
final String attValue = atts.getValue(i);
for (XMLListener l : listeners) {
l.attributeRead(qName, attName, attValue);
}//next attribute
}//else: no attributes
}//startElement()
* Overwrites super.
* Receive notification of character data inside an element. This method can be called multiple times
* from SAX, so we need to append all results of all calls to the final element value.
@Override
public void characters(final char ch[], final int start, final int length) {
String s = new String(ch, start, length);
elementValue.append(s);
}//characters()
* Overwrites super.
* Receive notification of the end of an element.
@Override
public void endElement(final String uri, final String localName, final String qName) {
for (XMLListener l : listeners) {
l.elementEnded(qName, elementValue.toString());
elementStack.pop();
}//endElement()
* Overwrite super.
* Receive notification of the end of the document.
@Override
public void endDocument() {
for (XMLListener l : listeners) {
l.documentEnded();
}//endDocument()
}//XMLHandler -
Script : How to add a progress bar to XMP Writing script ?
Hi !
I have this script that works flawlessly but when i execute it on big video files ( > 1GB) bridge doesn't repaint and it looks like it's stuck. I would like to have a progress bar showing % remaining on the task and the name of the file being treated. Can someone point me into the right direction as my adobe scripting knowledge is not that great.
#target bridge
if( BridgeTalk.appName == "bridge" ) {
descToTitle = MenuElement.create("command", "Log Comment to Description", "at the end of Tools");
descToTitle.onSelect = function () {
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var thumb = app.document.selections;
for(var s in thumb){
if(thumb[s].hasMetadata){
var selectedFile = thumb[s].spec;
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var myXmp = myXmpFile.getXMP();
var LogComment = myXmp.getProperty(XMPConst.NS_DM, "logComment");
myXmp.deleteProperty(XMPConst.NS_DC, "description");
myXmp.appendArrayItem(XMPConst.NS_DC, "description", LogComment, 0, XMPConst.ALIAS_TO_ALT_TEXT);
myXmp.setQualifier(XMPConst.NS_DC, "description[1]", "http://www.w3.org/XML/1998/namespace", "lang", "x-default");
if (myXmpFile.canPutXMP(myXmp)) {
myXmpFile.putXMP(myXmp);
myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
} else {
xmpFile.closeFile();
Thx in advance for helping me !I am using this progress bar on bridge. I don't remember who gave it to me time ago.
Anyway I have adapt it to your script:
#target bridge
if( BridgeTalk.appName == "bridge" ) {
descToTitle = MenuElement.create("command", "Log Comment to Description", "at the end of Tools");
descToTitle.onSelect = function () {
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var thumb = app.document.selections;
var progBar = new createProgressWindow("Work in Progress", "Please wait", false);
for (var s in thumb) {
if(thumb[s].hasMetadata) {
var selectedFile = thumb[s].spec;
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var myXmp = myXmpFile.getXMP();
var LogComment = myXmp.getProperty(XMPConst.NS_DM, "logComment");
myXmp.deleteProperty(XMPConst.NS_DC, "description");
myXmp.appendArrayItem(XMPConst.NS_DC, "description", LogComment, 0, XMPConst.ALIAS_TO_ALT_TEXT);
myXmp.setQualifier(XMPConst.NS_DC, "description[1]", "http://www.w3.org/XML/1998/namespace", "lang", "x-default");
progBar.updateProgress (Math.floor((Number(s)+1)*(100/thumb.length)), "Waiting, " + Math.floor((Number(s)+1)*(100/thumb.length)) + "% completed.");
if (myXmpFile.canPutXMP(myXmp)) {
myXmpFile.putXMP(myXmp);
myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
} else {
xmpFile.closeFile();
function createProgressWindow(title, message, hasCancelButton) {
var win;
if (title == null) title = "Work in progress";
if (message == null) message = "Please wait...";
if (hasCancelButton == null) hasCancelButton = false;
win = new Window("palette", "" + title, undefined);
win.bar = win.add("progressbar", {x: 20,y: 12,width: 300,height: 20}, 0, 100);
win.stMessage = win.add("statictext", {x: 10,y: 36,width: 320,height: 20}, "" + message);
win.stMessage.justify = 'center';
if (hasCancelButton) {
win.cancelButton = win.add('button', undefined, 'Cancel');
win.cancelButton.onClick = function() {
win.close();
throw new Error('User canceled the pre-processing!');
this.reset = function(message) {
win.bar.value = 0;
win.stMessage.text = message;
return win.update();
this.updateProgress = function(perc, message) {
if (perc != null) {
win.bar.value = perc;
if (message != null) {
win.stMessage.text = message;
return win.update();
this.close = function() {
return win.close();
win.center(win.parent);
return win.show(); -
How to use the PROGRESS Event?
Can someone explain to me how to use the PROGRESS event, i looked at the docs but it never helped me?
I want to use it to display the prgress of downloading data from a API, its a URL event. But i was told i can do this via a PROGREE Eventcopy and paste the trace output from:
import flash.events.ProgressEvent;
//var facebookAPI:String = "https://graph.facebook.com/ginorea1/feed?access_token=277830088900615|2.AQDUBMBocIw_QcqE.3600.1313856000.0-100001000396080|5bXT8Cj0OUxNpr7y NeqTsJfwADg";//
var facebookAPI:String = "https://graph.facebook.com/100001000396080/statuses?access_token=14563 4995501895|2.AQAKdU4pcsdMmmBO.3600.1313859600.0-100001000396080|7uzAMoRdsg5kXLjc exS5bVaPhag";
var loader:URLLoader = new URLLoader(new URLRequest(facebookAPI));
loader.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(ProgresEvent.PROGRESS,loadProgress);
function loadProgress(e:ProgressEvent):void
trace(e.bytesLoaded,e.bytesTotal);
progress_txt.text = String(Math.floor((e.bytesLoaded/e.bytesTotal)*100));
function loadComplete(e:Event):void{
processData(e.target.data);
function processData(data:String):void
var facebookFeed:Array = JSON.decode(data).data as Array;
for (var i:uint, feedCount:uint = 10; i < feedCount; i++)
var tf2:TextField=new TextField();
feed1.text = facebookFeed[i].message;
feed2.text = facebookFeed[2].message;
feed3.text = facebookFeed[3].message;
feed4.text = facebookFeed[4].message;
feed5.text = facebookFeed[5].message;
feed6.text = facebookFeed[6].message;
feed7.text = facebookFeed[7].message;
feed8.text = facebookFeed[8].message;
feed9.text = facebookFeed[9].message;
feed10.text = facebookFeed[10].message;
stop(); -
How to make use of *progress bar*?
I have a progress bar requirement in my swings project,
i.e on clicking a button, some task should be executed and in parallel to this
progress should run on progress bar in the same frame and soon after this task
gets completed the progress on progress bar should come to an end.
How can i do this in swings?
could any one help me out from this?How to use progress bar
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
If you want an example scroll down to the bottom of the page and download the examples. -
How to create/set progress bar for loading flash intro
Hi,
I am having a falsh intro for my website.
But its taking time to download and play the intro when we try to access it.
I have seen many sites with progress bar indicating the status on the downloading of flash items.
Can anybody please tell me how should I go about this?You can make a simple loader, it's a visual cue so your users wait for a moment.
Try this, get a GIF from one of these site: http://www.google.com/search?hl=en&client=safari&rls=en-us&q=loading+gif&btnG=Se arch
download it and name it as loader.gif
add it to you page, and add the following to the page using HTML Snippet:
<script type='text/javascript'>
var timerCount = 0;
var delayTimer = 5; // change this for the duration to show the loader.gif
var loaderName = 'loader.gif';
function stopLoader() {
_imgs = parent.document.getElementsByTagName('img');
for (ji = 0; ji< _imgs.length; ji++) {
if (_imgs[ji].src.indexOf(loaderName) != -1) {
loaderElement = _imgs[ji];
break;
if (timerCount == delayTimer) {
loaderElement.style.visibility = 'hidden';
clearInterval(_stopLoader);
timerCount++;
parent.iWLog(timerCount);
_stopLoader = setInterval('stopLoader()', 1000);
</script>
BTW, here is an example: http://hdl.50webs.com/Sample/Blank.html -
I don't know how to word this - "Progress bar" maybe???
Hi Everyone!
I've been a lurker here on occasion, but never posted. I'm sure this has been covered somewhere, but what I'm trying to do is place a "loading" page or progress bar that loads my pages before they're shown to the visitor...maybe an hourglass or a bar of some sort, y'know? I think it looks unprofessional to visit a site and watch each item as it loads. Know what I'm sayin'????Hi -- Welcome to the discussions. They're called animated Flash "preloaders" which show a progress bar, e.g.
http://www.verticalmoon.com/products/swflockload/swflockload.htm
...but I'm not sure how practical it would be to use them for general web-page loading; perhaps another forum reader could chip in here.
If you decide to experiment, you could try integrating preloaders into your site via either of the following:
http://web.mac.com/cbrantly/iWeb/Software/iWeb%20Enhancer.html
or...
http://iweb.varkgirl.com
(Click on the first "tip" link in the list) -
How to make a progress bar or a waitting page?
page1.cfm
<form action="InputDB.cfm" method="post">
<input id="inputdb" type="submit" value="InputNow">
</form>
InputDB.cfm
<cfloop from="1" to "9000000" index="x">
if it inputs the 9000000 records into the database,
it will spend a lot of time,how to do make a progress bar
or a waitting page when Users wait for the time?
</cfloop>
Thanks a lot.Waiting pages are easy.
Step 1, convert form variables to session variable.
Step 2, display something.
Step 3, use js window.location to call the action page. Don't
use cflocation. Even though it works, you lose your display. -
Hi all,
I want to keep a progress bar to my views on each action.How to keep that??
Can anyone plz help me out
Regards
Padma NHi,
A progress bar has 3 main properties namely
1) barcolor -which will decide color of progressbar.
create a context say ctx_barcolor of ProgressIndicatorBarColor type
which u can find in com.sap.ide.webdynpro.uielementdefinitions
2) percentvalue -This will decide the curent length of indicator.
This should be an integer say ctx_prcnt.
3) displayvalue -This will decide which value u want to display in ur progress bar.
This should be a String.For instance say ctx_dispval.
Now suppose I want to set my progress bar to 80% and say of green color.
Then first of all I will set percentvalue property.
wdContext.currentcontextelement.setCtx_prcnt(80);
Then I will set barcolor property.
wdContext.currentContextElement().setCtx_barcolor(WDProgressIndicatorBarColor.POSITIVE);
And finally I will set displayvalue property.
wdContext.currentContextElement().setCtx_dispval(wdContext.currentContextElement().getCtx_va_prcnt()+"%");
Collectivelly
wdContext.currentcontextelement.setCtx_prcnt(80);
wdContext.currentContextElement().setCtx_barcolor(WDProgressIndicatorBarColor.POSITIVE);
wdContext.currentContextElement().setCtx_dispval(wdContext.currentContextElement().getCtx_va_prcnt()+"%");
I hope this helps
Regards
Surender Dahiya -
How to create a progress bar showing status on timeout of TCP Read function
Is there any way of creating a progress bar showing the status of a 'TCP Read timeout' time ... ?
I'm sending a data request to an intranet server via TCP Write, and then using TCP Read with a 2 min. timeout to receive the requested data. During this time i want to show the actual progress of the timeout in a progress bar.
Can this be done?
And do i have to implement some kind of multitasking to make it happen?
TIASoulstorm wrote:
> Is there any way of creating a progress bar showing the status of a
> 'TCP Read timeout' time ... ?
>
> I'm sending a data request to an intranet server via TCP Write, and
> then using TCP Read with a 2 min. timeout to receive the requested
> data. During this time i want to show the actual progress of the
> timeout in a progress bar.
> Can this be done?
> And do i have to implement some kind of multitasking to make it
> happen?
It can be done and you need to do some multitasking yes, but that is
quite easy in LabVIEW. A separate loop or subVI with loop will be
responsible for the progress bar. Set its scale to 0 and the number of
seconds of your timeout. In parallel to the TCP Read let this loop or VI
execute reading the time every few
seconds and calculating the
difference to its start time, passing this value to the progress bar
slider. Have an extra boolean global which aborts the loop and set this
boolean to FALSE before starting the loop/VI and TCP Read and setting it
to TRUE on return of the TCP Read.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Is it possible to use a progress bar in Photoshop?
Hi,
I'm developing an automation plug-in to Photoshop. It take long time to do the work, I therefore want to start a none modal dialog with a progress bar and a cancel button. I did not find any example of this in the SDK. Is it possible to use any of the functions in the PIProgressSuite.h for this kind of dialog?
Regards,
MattiasI don't think you will have much luck with the progress suite. It is used for one operation that your plug-in would control. You are probably using multiple Photoshop events and want to sum them up in a progress bar. Ideally you would want a double progress bar, one for the overall progress and one for the step progress. Unfortunately, the progress suite will get reset with each process that Photoshop tries to show progress for. Your best bet is to just use an OS progress bar in your dialog. Figuring out the progress will be dificult.
Maybe you are looking for
-
Is Verizon going to end up with a Class Action Lawsuit regarding the Trade-In Scam?
I notice I'm not the first to report this issue. In fact, after reading the horror stories in the community, I'm questioning if going with Verizon Wireless and/or using their online trade-in program was the right thing to do. I see so many other pe
-
HP recovery freezes when I prep restoring factory image
A user had the recovery disks for my laptop, and tried to run them to restore his laptop to factory settings. But, after putting in the second disk, it frozen and was stuck at 0%. According to the prompts from software, Hard drive’s windows partition
-
Networking Printer on MBA with Cisco Network Magic
I have Kodak ESP-3 printer attached to Windows Vista PC and networked with Cisco Network Magic to Windows Laptop. I have installed Cisco Network Magic for MAC on MBA. There seems to be a problem in that the MBA doesn't pick up the printer,links with
-
I've tried turning the iCloud calendar on and off, but that hasn't helped. thanks
-
Acobat Pro 7.10, WinXp, sp. 2. My Acrobat GUI isn't in English, so I will try to explain. In the toolbar "Files" the search button with the binoculars graphic doesn't work. When clicking it nothing happens and Acrobat stops to work. The toolbar "Sear