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: Using time

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using time

    Hi All,

    My Question concerns : "Doing things continuously over time", here is the problem details : (Java and NOT JavaScript)

    Suppose that we need to change the position of a Swing item (JCheckBox for example) from the position : (0,0,70,25) to (100,0,70,25).

    Usually i do : MyBox.setBounds(100,0,60,25);

    ... And the Box then is moved to the new posiyion IN ZERO SECONDS.

    ... But, what if we need it to go to the new position continuously TAKING 1 SECONDE or more ??!

    (i.e. we need it to move continuously starting from (0,0,70,25) and arriving to (100,0,70,25) in a trip taking 1 second or more)

    Same Question for many other Actions like Changing a Panel Size, Changing a Label Color and so ...

    i have a general idea that we have to use something like Threads or others may be !? but i need a very simple example showing how to do that in a very simple and quick code...

    Many thanks for any help.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Using time

    See posts at Using Time - Java Forums

Similar Threads

  1. how to make a program take time...
    By DLH112 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 10th, 2010, 07:09 PM
  2. display time
    By kalees in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: January 1st, 2010, 07:40 AM
  3. [SOLVED] how to get phone time and date
    By mahdi in forum Java ME (Mobile Edition)
    Replies: 2
    Last Post: August 26th, 2009, 11:15 AM
  4. SQL Time Calculation
    By r12ki in forum JDBC & Databases
    Replies: 3
    Last Post: July 31st, 2009, 03:54 AM
  5. How to Get the current date and time
    By JavaPF in forum Java Programming Tutorials
    Replies: 2
    Last Post: December 2nd, 2008, 01:55 PM