How to show progress bar in java???

Hey guys!!! can any one tell me how to show the progress bar when a processing is going on???Is it done by multithreading?? I have to import data from database kept in another machine into my database.It would take quite a longer time especially when database is quite large.I want to show the progress and every data being imported to the user so that user does not think that system has hanged on...Please help...

i answered here:
http://forum.java.sun.com/thread.jspa?messageID=9739423&#9739423

Similar Messages

  • How to show progress bar in miniplayer?

    How to show progress bar in miniplayer? I play a lot of music podcasts and it would be very helpful if anyone could help me bring that feature back.

    i answered here:
    http://forum.java.sun.com/thread.jspa?messageID=9739423&#9739423

  • How to show progress bar

    how to show progress bar

    This gets asked about 100 times a day, especially when you get people posting it multiple times - learn to use the search facility, or at least Google. It's really not that hard.
    Type "java progress bar" into Google and hit "I'm feeling lucky" - the answer is there.

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

    So 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 create progress bar in web page!!!

    Dear,
    I do not know how to create progress bar in web page?
    Please show me the way to solve it.
    Best regards,
    Huy

    God your lucky/lazy
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    public class ProgressBar extends Applet
      private boolean isStandalone = false;
      private int width;
      private int height;
      private double percentComplete;
      private double fundsTarget;
      private double fundsRaised;
      private Properties values;
      private String propertiesFile;
      private JPanel jPanel1 = new JPanel();
      private JProgressBar PB_FUNDS_PROGRESS = new JProgressBar();
      private GridLayout gridLayout1 = new GridLayout();
      private BorderLayout borderLayout1 = new BorderLayout();
      private JPanel jPanel2 = new JPanel();
      private JLabel jLabel1 = new JLabel();
      private JLabel jLabel2 = new JLabel();
      private JLabel jLabel3 = new JLabel();
      private GridBagLayout gridBagLayout1 = new GridBagLayout();
      private JPanel jPanel3 = new JPanel();
      private JLabel jLabel4 = new JLabel();
      //Construct the applet
      public ProgressBar()
      //Initialize the applet
      public void init()
        try
          jbInit();
        catch(Exception e)
          e.printStackTrace();
      //Component initialization
      private void jbInit()
      throws Exception
        fundsTarget = new Double( 100 ).doubleValue();
        fundsRaised = new Double( 50 ).doubleValue();
        PB_FUNDS_PROGRESS.setBackground(Color.green);
        PB_FUNDS_PROGRESS.setForeground(Color.red);
        this.setLayout(gridLayout1);
        jPanel1.setLayout(borderLayout1);
        jPanel2.setLayout(gridBagLayout1);
        jPanel1.setBackground(Color.white);
        jPanel2.setBackground(Color.white);
        jPanel3.setBackground(Color.white);
        jLabel2.setBackground(Color.white);
        jLabel1.setBackground(Color.white);
        jLabel3.setBackground(Color.white);
        jLabel4.setText(" ");
        jLabel1.setText(" ");
        jLabel2.setText(" ");
        jLabel3.setText(" ");
        this.setBackground(Color.white);
        this.add(jPanel1, null);
        jPanel1.add(PB_FUNDS_PROGRESS,  BorderLayout.CENTER);
        jPanel1.add(jPanel2, BorderLayout.SOUTH);
        jPanel2.add(jLabel2, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 0), 0, 0));
        jPanel2.add(jLabel1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 150, 5, 5), 0, 0));
        jPanel2.add(jLabel3, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6, 5, 4, 150), 0, 0));
        jPanel1.add(jPanel3, BorderLayout.NORTH);
        jPanel3.add(jLabel4, null);
        propertiesFile = this.getCodeBase().getFile().replaceAll("%20", " ")+"funds.properties";
        System.out.println("Properties file at " + propertiesFile);
        values = new Properties();
        try
          values.load(new FileInputStream(propertiesFile));
          fundsTarget = new Double( values.getProperty("TARGET", "100").toString() ).doubleValue();
          fundsRaised = new Double( values.getProperty("RAISED", "50").toString() ).doubleValue();
          System.out.println("target: " + fundsTarget + " raised: " + fundsRaised);
        catch (IOException ioe)
          System.err.println(ioe.getMessage());
        percentComplete = (fundsRaised/fundsTarget)*100;
        System.out.println(percentComplete);
      //Start the applet
      public void start()
        PB_FUNDS_PROGRESS.setMaximum(new Double(fundsTarget).intValue());
        PB_FUNDS_PROGRESS.setMinimum(0);
        repaint();
      //Stop the applet
      public void stop()
      public void paint(Graphics g)
        Graphics2D g2 = (Graphics2D)g;
        PB_FUNDS_PROGRESS.setValue(new Double(fundsRaised).intValue());
        String percent = Double.toString(percentComplete).substring(0, 4);
        jLabel4.setText("Currently At " + percent + "%");
        jLabel1.setText("100%");
        jLabel2.setText("50%");
        jLabel3.setText("0%");
      //Destroy the applet
      public void destroy()
      public String getAppletInfo()
        return "Funds progress applet by A really nice person";
    }

  • Show progress bar before loading the applet or application

    hi ,
    My application size is large and take some time to load . Now i want that to show progress bar . how can i do this .Please Help me
    sorry for my english.
    Thanks

    Do everything in a seperate thread. Create a progress bar in the main thread, then create a new thread for initializing your app. Once the init is done, hide the progress bar and make your app visible.

  • How to create progress bar?

    pls,can anyone tell me? how to create progress bar?
    thanks,
    screen410099

    it is well documented how to create progressbars on page 173 in Solutions.pdf
    also you can find sample code in InDesign SDK\sources\sdksamples
    Regards
    Bartek

  • How to show error message using java.awt?

    How to show error message using java.awt?
    Which is the class corresponding to the JOptionPane?
    Or I need to use Frame ?

    No, JOptionPane is swing!
    You would have to create your own frame, put your message in it, then show it.

  • Show Progress Bar while only on Page Load.

    Hi Experts,
    I want to show progress bar every time when page loads.
    Progress bar is coming on the page. but it is not going off after page is loaded.
    Below is the code which i added for the Progress bar.
    //written on Header Text of Page
    <script type="text/javascript">
    <!--
    function html_Submit_Progress(pThis){
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    //-->
    </script>
    //written on footer text of Page
    <style> #AjaxLoading{padding:5px;font-size:18px;width:200px;text-align:center;left:20%;top:20%;position:absolute;border:0px solid #666;}
    </style>
    <div id="AjaxLoading" style="display:none;"><br /><img src="#APP_IMAGES#progress_bar.gif" id="wait" /></div>
    //called the function Execute on Page Loads 
    html_Submit_Progress(this);Progress bar is continuously showing on the page after page is loaded.
    I want only to show only page loads.
    Please help me .
    Apex Version : Apex 4.1
    DB Version : 10g
    Regards,
    Jitendra

    Hide the loader element when the page has loaded. Put this in the javascript section
    $(document).ready(function(){ $x_Hide('AjaxLoading'); });Or put it in the page load section
    $x_Hide('AjaxLoading');Or create a dynamic action which fires on page load, select a hide action, and use a jQuery selector to target '#AjaxLoading' as an affected element.

  • How to read file asychronous and show progress bar??

    Hello Everyone,
    I am new here and this is my first post here. I made a desktop application in Adobe flex builder 3. In the application I took the path of a folder and merge all the file present in that folder in a new file. I want to show the progress bar when file merging, because it take some time to merge large number of files. I read and write files synchronously. I made the progress bar but when I called it before the file merging happening nothing happened.
    How can I do this??
    Thanks

    if you are using desktop im going to asume you are using air. if thats the case, im not to sure however on the web what you have to do is update the progress bar with some action.
    you can also consider using the  
    cursorManager.setBusyCursor();
    and when you are done then
    cursorManager.removeBusyCursor();
    let me know how you make out.
    Miguel

  • How to Create Progress Bar in SAP

    Hi!
            I need to know how to create a progress bar in Sap Business One with VB.Net to Show  a Scheduling Status.

    Hi Parag,
    The code you need to create a progress bar is:
    Dim Progress as Integer
    Dim oProgressBar As SAPbouiCOM.ProgressBar
    oProgressBar = oApplication.StatusBar.CreateProgressBar("YOUR_TEXT", oRecordset.RecordCount, True)
    oProgressBar.Text = "YOUR_TEXT"
    and for each record:
    Progress += 1
    oProgressBar.Value = Progress
    When all is finished
    oProgressBar.Stop()
    Regards,
    vanesa

  • Progress Bar in Java

    Hi,
    I'm new here, i need to create a Progress Bar for my application,
    but i just don't get how to get back how much that a process has proceed,
    can anyone help me? i have stuck at here for a few days
    example; i do a System.out.Println("blablabla")
    how to see it's done or how many percent have been done?
    or anyone can give me a good example of Java Progress Bar?
    Any help will be very appriciated.

    By using this method
    public boolean saveAs(Shell shell) {
              FileDialog saveDialog = new FileDialog(shell, SWT.SAVE);
              saveDialog.setFilterExtensions(new String[] { "*.xsd;", "*.*" });
              saveDialog.setFilterNames(new String[] {
                        "XML Schema Definition (*.xsd)", "All Files " });
              saveDialog.open();
              String name = saveDialog.getFileName();
              if (name.equals(""))
                   return false;
              if (name.indexOf(".xsd") != name.length() - 4) {
                   name += ".xsd";
              File file = new File(saveDialog.getFilterPath(), name);
              if (file.exists()) {
                   MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES
                             | SWT.NO);
                   box.setText("Save As");
                   box.setMessage("File " + file.getName() + " is already exits "
                             + "\n" + "Do you want to replace it?");
                   if (box.open() != SWT.YES) {
                        return false;
              this.file = file;
              this.saveToPath = saveDialog.getFilterPath();
              return save(shell);
         public boolean save(Shell shell) {
              if (file == null)
                   return saveAs(shell);
              Cursor waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
              shell.setCursor(waitCursor);
              FileWriter fileWriter = null;
              try {
                   fileWriter = new FileWriter(file.getAbsolutePath(), false);
                   fileWriter.write(text.getText());
              } catch (FileNotFoundException e) {
                   displayError("File_not_found " + file.getName(), shell);
                   return false;
              } catch (IOException e) {
                   displayError("IO_error_write" + "\n" + file.getName(), shell);
                   return false;
              } finally {
                   shell.setCursor(null);
                   waitCursor.dispose();
                   if (fileWriter != null) {
                        try {
                             fileWriter.close();
                        } catch (IOException e) {
                             displayError("IO_error_close" + "\n" + file.getName(),
                                       shell);
                             return false;
              return true;
         }

  • Show progress bar and percents when packaging a native installer with adt packager

    Hello,
    Below is a simple example using the AIR's NativeProcess for compiling an air application into a native installer... Everything works fine, so at the end of the NativeProcess, the native installer (*.exe) is created... In this case, the application which I'm trying to compile is small (approx. 600KB)... However, if I have to package into native installer a bigger file (several MBs), I would like also to monitor the progress by using a progress bar and percents... How?
    private var file:File
    private var nativeProcessStartupInfo:NativeProcessStartupInfo;
    private var nativeProcess:NativeProcess;
    private function compile():void{
      file = new File("C:\\Program Files\\Java\\jre7\\bin\\java.exe");
      nativeProcessStartupInfo = new NativeProcessStartupInfo();
      var args:Vector.<String> = new Vector.<String>();
      args.push("-jar");
      args.push(adtPath);
      args.push("-package");
      args.push("-storetype");
      args.push("pkcs12");
      args.push("-keystore");
      args.push(certPath);
      args.push("-storepass");
      args.push("mypass");
      args.push("-target");
      args.push("native");
      args.push(exePath);
      args.push(xmlPath);
      args.push("-C");
      args.push(swfPath);
      args.push("testApp.swf");
      args.push("icons");
      nativeProcessStartupInfo.arguments = args;
      nativeProcessStartupInfo.executable = file;
      nativeProcess = new NativeProcess();
      nativeProcess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
      nativeProcess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
      nativeProcess.start(nativeProcessStartupInfo);
    private function onOutputData(event:ProgressEvent):void{
       var op:String =  nativeProcess.standardOutput.readUTFBytes(nativeProcess.standardOutput.bytesAvailable);
       trace("output = " + op);
    private function onErrorData(event:ProgressEvent):void{
       var er:String = nativeProcess.standardError.readUTFBytes(nativeProcess.standardError.bytesAvailable);
       trace("error = " + er);
    Thanks in advance,
    Nikola

    Someone to offer a solution to this problem (if exists)?

  • Feature Request - Bring back the show progress bar

    Just in case Verizon is looking for suggestions here, can you please bring back the progress bar that was behind the start/end times in the guide? In the current guide, there is no quick graphical cue to represent how much time has progressed in the selected show. Yes, you can look at the start, end, and current times, but when browsing through shows that start/end at different times, it really slows browsing down.
    I've uploaded two images to illustrate the issue.
    The first image below is a screenshot of the v1.9 guide. The second image is a mock-up that shows the feature that I am talking about. Note the progress bar for the currently selected show in the guide that appears behind the start and end times ("7:35 AM - 9:30 AM" on the right side of the screen, in the middle).
    This was available in the previous guide, but was omitted in 1.9. It is a very useful feature. Please bring it back.
    (NOTE: The white progress bar at the top of the screen does NOT represent the progress through the show selected in the guide. It just shows the current time.)

    shadow715 wrote:
    The first image below is a screenshot of the v1.9 guide. The second image is a mock-up that shows the feature that I am talking about. Note the progress bar for the currently selected show in the guide that appears behind the start and end times ("7:35 AM - 9:30 AM" on the right side of the screen, in the middle).
    This was available in the previous guide, but was omitted in 1.9. It is a very useful feature. Please bring it back.
    (NOTE: The white progress bar at the top of the screen does NOT represent the progress through the show selected in the guide. It just shows the current time.)
    I'm sorry, but I just do not see the benefit of the elapsed time thing you propose. What difference does it make to see some kind of indicator how far into the program you are? You can't change where you are, you are there, period.
    But if you really, really want to know:
    1) Just look at the start time and end time shown in the current program in the middle, and look at the TOD shown at the top, and estimate where you are.
    - or -
    2) Hit the Info button once and see a bar that definitively shows how far in you are.
    Could you please explain why you think having that feature is so useful? I just don't see it.
    Thanks.
    Justin
    FiOS TV, Internet, and phone user
    QIP7232, QIP7100-P2, IMG 1.9A
    Keller, TX 76248

  • Show progress bar while module loads

    I have a TabView where each tab is a module. One of the
    modules has a lot of child components and when I click to activate
    that tab - it takes 2-3 seconds to load. During this time OSX shows
    the beach ball.
    Is it possible for me to show a loading progress bar instead?
    Should I be pre-loading all the modules when the application loads,
    or at some other point? If so, how do I do this?
    Any suggestions would be appreciated.

    Hey Jason,
    I'm not sure who moderates, but I can send you in the right
    direction.
    Short answer: Look around for Asynchronous Flex demos
    Long answer:
    The interfaces locks up (beach ball/hour glass) because the
    main application 'thread' is busy with the task you asked of it.
    This can, in many different languages, cause a freeze. Javascript,
    Native Mac or Windows applications, apparently Flex too.
    Running one task at a time is considered a synchronous
    (serial) request. What you need to do is make an asynchronous
    (parallel) request. In the web world, that's the 'A' in Ajax. By
    making asynchronous requests, you free up the main 'thread', while
    a separate worker thread is off completing the task. This keeps
    your interface responsive.
    I think that leads to event listeners.. Send off a background
    request, but listen for it to complete. Link the listener to a
    second piece of code upon successful completion.
    I wish I could get into more detail, but I'm not a Flex guy..
    hoped that at least helped gel the idea.
    -dp

Maybe you are looking for