Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
timer
- Page 1
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by toneewa
…{ private static final int delay = 16; protected
Timer
timer
; ArrayList<Ball> b = new ArrayList<…Ball[] balls) { b.addAll(Arrays.asList(balls));
timer
= new
Timer
(delay, this);
timer
.start(); } public void actionPerformed(ActionEvent e) { …
Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by jprog1000
…ActionListener { private int delay = 10; protected
Timer
timer
; Ball b[]; public BallPanel(Ball b[]) {…++){ this.b[i] = b[i]; }
timer
= new
Timer
(delay, this);
timer
.start(); } public void actionPerformed(ActionEvent e) {…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by toneewa
…{ private static final int delay = 1; protected
Timer
timer
; ArrayList<Ball> b = new ArrayList<…Ball[] balls) { b.addAll(Arrays.asList(balls));
timer
= new
Timer
(delay, this);
timer
.start(); } public void actionPerformed(ActionEvent e) { …
Create And Install Windows Service Step By Step In C#
Programming
Web Development
2 Months Ago
by Rabiya_1
…{ InitializeComponent(); timeDelay = new System.Timers.
Timer
(); timeDelay.Elapsed += new System.Timers.ElapsedEventHandler….ElapsedEventArgs e) { string process = "
Timer
Tick " + count; LogService(process); …
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by jprog1000
Thank you so much for your reply and additions! It is certainly working as I wanted. I will read through the code you have added and ask you any questions I might have. I hope you don't mind. Regards
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by Dani
I’ll mark this question solved :)
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by Dani
… oh, sorry, missed the bit about you still needing clarifications. Feel feee to ask :) I’ll now unmark this topic as solved. /facepalm
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by jprog1000
Hello, Thank you again so much! All your additions are clear, but it seems like whenever two balls collide, more than one ball is added to the arraylist and painted. Any way to have just one ball added to the panel for every collision? Have some kind of a toggle flag in paintcomponent? Regards
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by toneewa
Yes, this is true. Overlapping ball spawns can do that causing a chain reaction. Something like that could be done. How you handle the spawning of the new ball is what I played with a bit before. You will see better collision detection changing to: g.fillOval(ball.getX(), ball.getY(), 1 * ball.getRadius(), 1 * ball.getRadius());
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Month Ago
by jprog1000
Got it. Thank you so much!
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Month Ago
by aishamushtaq
Hi, Its helpful for me. I got my answer.
Re: Create And Install Windows Service Step By Step In C#
Programming
Web Development
2 Months Ago
by rproffitt
Since the answer would be many pages long, read https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer and consider the two other pages noted there.
Re: how to create a simple elevator simulation?
Programming
Software Development
1 Month Ago
by trueframe
To make a basic elevator simulation, first, identify the floors and the elevator's capacity. Then, use loops and conditionals in programming to mimic its movement. Include buttons for users to call the elevator and select floors. Test thoroughly for accuracy.
timer program for c#
Programming
Software Development
13 Years Ago
by virusisfound
timer
i have two labels in C# windows Application and i … form load : label1.visible = true; label2.visible.false; and on
timer
tick event: label1.visible.false; label2.visivle = true; now after…
Re: timer
Programming
Web Development
11 Years Ago
by AleMonteiro
… time currentTime: 0, // Initialize
timer
init : function() {
timer
.div = document.getElementById(
timer
.divId);
timer
.interval = setInterval(function() {
timer
.currentTime = currentTime + 1;
timer
.updateTimeDisplay(); }, 1000); // 1000 milliseconds…
Re: timer
Programming
Web Development
14 Years Ago
by rajkumartr
…long as it is needed. // If the
timer
is declared in a long-running method, //…(See end of method.) //System.Timers.
Timer
aTimer; // Create a
timer
with a ten second interval. aTimer =…the program."); Console.ReadLine(); // If the
timer
is declared in a long-running method, use…
Re: timer
Programming
Software Development
16 Years Ago
by AV Manoharan
[quote=QVeen72;406243]Hi, Place the
Timer
in any of the Form, and set its "… Form, then forst place a Frame Control and place the
timer
on that frame. REgards Veena[/quote] Veena, I think… he meant not Exactly a
timer
event. What he wants is when any of his form…the details. I am confident that he knows the
timer
event.
Timer
Programming
Software Development
16 Years Ago
by Adila
…().add(sad); myFrame1.setSize(400, 200); myFrame1.setVisible(true); } };
Timer
test = new
Timer
(1000, taskPerformer); test.start(); //wait 10 seconds before going… to play again?", "", JOptionPane.YES_NO_OPTION); [/code] the
timer
is working, but why doesn't the MySadFace work? thanks
Re: Timer
Programming
Software Development
16 Years Ago
by Adila
…(JFrame.EXIT_ON_CLOSE); myFrame.setSize(400, 200); myFrame.setVisible(true); } };
Timer
test = new
Timer
(1000, taskPerformer); test.start(); //wait 3 seconds before going…
Re: Timer
Programming
Software Development
12 Years Ago
by swathys
the
timer
doesn't work at all if i run the application (by mean it doesn't go to the
timer
function at all) but when i use debug breakpoint and debug line by line it goes to the
timer
function and work as it suppose to be . So now i don't know whats wrong with my code actually.
Re: timer
Programming
Web Development
11 Years Ago
by Taywin
…;).value = "Stop" ticking(); // tick the
timer
} } function ticking() { var milliEl = document.getElementById("…ticking function resetTimer() { if (running) { runTimer(); } // stop the
timer
first if is running document.getElementById("min").value…
Timer Help
Programming
Software Development
17 Years Ago
by matthefridgeman
Hi im new to VB and ive built a program that uses two timers to produce an osilating output..But i want to change the value of each
timer
INTERVAL prior to running the timers. Ive created two txt boxes to hold the
timer
interval times and a start button..It all works at the moment except the txt boxes..
timer
Programming
Software Development
16 Years Ago
by plusplus
… any of them is open. How do I program a
timer
to do that every few minutes? The first time I… after the program is opened, where would I put the
timer
Re: timer
Programming
Software Development
16 Years Ago
by QVeen72
Hi, Place the
Timer
in any of the Form, and set its "Interval" 10000 (for 10 Seconds) Write the Checking code in Timer1_Timer Event, Make the Event as Public and u can access it from every where. If u have a MDI Form, then forst place a Frame Control and place the
timer
on that frame. REgards Veena
Timer
Programming
Software Development
12 Years Ago
by swathys
Hi i have problem with my
timer
. when application run it does not go to the
timer
at all.I have no idea…
Re: Timer
Programming
Software Development
12 Years Ago
by Pgmer
try setting the
timer
enable at proprties where u set the time. And make sure that the function or method in which ur using the
timer
is firing and running fine.
Re: Timer
Programming
Software Development
12 Years Ago
by swathys
… Timer2.Start() End If Application.DoEvents() Debug.Print("after
timer
") End Sub[/CODE] [COLOR="Red"]it goes… happen after i run my application. It doesn't goto
timer
at all.[/COLOR]
Re: Timer Help
Programming
Software Development
17 Years Ago
by matthefridgeman
Thanks for you reply..if i wanted a txt box to set the interval
timer
i could just change the 1000 in your code to a variable ''say I''..Its a work in progress thought..lol
Re: Timer Help
Programming
Software Development
17 Years Ago
by 2thestart
For a text box i would do n=val(frminput.text1.text) and you can now put "n" into the
timer
code i gave you frminput.timer1.interval=n ;)
Re: Timer Help
Programming
Software Development
17 Years Ago
by matthefridgeman
[quote=2thestart;361762]For a text box i would do n=val(frminput.text1.text) and you can now put "n" into the
timer
code i gave you frminput.timer1.interval=n ;)[/quote] Thanks il have a play tonight...thanks alot for your time..u have saved me hours..
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC