Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: JProgressBar

  1. #1
    Member
    Join Date
    Jul 2012
    Posts
    37
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default JProgressBar

    How would I find out the percentage of data that has been downloaded from this code?

    public static void main(String[] args) throws Exception {
    		pageAddressUrl = new URL("http://oldschool1.runescape.com/");
    		String pageSource = readPageSource("http://oldschool1.runescape.com/");
    		parseParameters(pageSource);
    		String gamepackFileName = findGamepackFileName(pageSource);
    		URLClassLoader classLoader = new URLClassLoader(new URL[] { new URL(
    				"http://oldschool69.runescape.com/" + gamepackFileName) });
    		Applet game = (Applet) classLoader.loadClass("client").newInstance();
    		RS2Loader rs2Loader = new RS2Loader();
    		game.setStub(rs2Loader);
    		game.init();
    		game.start();
    		rs2Loader.add(game);
    		rs2Loader.setDefaultCloseOperation(3);
    		rs2Loader.setSize(773, 531);
    		rs2Loader.setTitle("RuneScape");
    		rs2Loader.setResizable(false);
    		rs2Loader.setVisible(true);
    	}

    I'm going to create a JProgressBar to load up while this is downloading.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: JProgressBar

    How would I find out the percentage of data that has been downloaded
    The forumula could be: Amount downloaded so far/ total to download * 100
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. JProgressBar Issues
    By dr3wmurphy in forum AWT / Java Swing
    Replies: 1
    Last Post: August 11th, 2012, 01:15 AM
  2. Jtable with JprogressBar
    By dibyayan in forum AWT / Java Swing
    Replies: 1
    Last Post: October 17th, 2011, 07:33 AM
  3. Problems with rendering a jprogressbar
    By albertof in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 10th, 2010, 04:47 AM
  4. Replies: 1
    Last Post: February 16th, 2009, 11:52 AM