Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 ….Graphics; import java.awt.Color; public class BallPanel extends JPanel implements ActionListener { private int delay = 10; protected Timer timer; Ball b… Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa ….ArrayList; import java.util.Arrays; public class BallPanel extends JPanel implements ActionListener { private static final int delay = 16; protected Timer timer… Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa ….ArrayList; import java.util.Arrays; public class BallPanel extends JPanel implements ActionListener { private static final int delay = 1; protected Timer timer… Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development 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 by Dani I’ll mark this question solved :) Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development 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 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 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 by jprog1000 Got it. Thank you so much! Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by vortex_1 In my opinion, implementing a feature in a bouncing balls simulation where a new ball is created when two balls collide can add an interesting and dynamic element to the simulation. This feature can introduce a sense of complexity and unpredictability, making the simulation more engaging and challenging for users. It could also provide an … Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Great reply, vortex! Agree with all your points. Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by aishamushtaq Hi, Its helpful for me. I got my answer. Paris Olympics Chatbot- Get Ticket Information Using Chat-GPT and LangChain Programming Computer Science by usmanmalik57 … the `document_chain,` which returns the final response. The following script implements the method to generate the final response. ``` def generate_response(query… Re: A reliable way of detecting AI content? Hardware and Software Cloud-based Apps by jkon … AI generated texts but I don't know anyone that implements them yet. In images they do it (e.g. DALL… Interface ... extends ... implements ... (Need help) Programming Software Development by balgarath …import java.rmi.RemoteException; public interface ToyStore extends Remote implements Observer { String sayHi() throws RemoteException; public void …import java.rmi.RemoteException; public interface ToyFactory extends Remote implements Observable { String sayHello() throws RemoteException; public void addObserver… '[Class] is not abstract..' error when i use 'implements' Programming Software Development by javaLearner …getting the following error when i declare anything that 'implements'. i remove the declarations and all subsequent code …in java.awt.event.ActionListener public class ChatClientApplication extends Frame implements ActionListener, Item Listener, WindowListener ^ 1 error ***********************END_OF_ERROR********************** Cheers… Re: '[Class] is not abstract..' error when i use 'implements' Programming Software Development by cosi …) in java.awt.event.ActionListener public class ChatClientApplication extends Frame implements ActionListener, Item Listener, WindowListener ^ 1 error ***********************END_OF_ERROR********************** Cheers.. :eek:[/QUOTE… Re: '[Class] is not abstract..' error when i use 'implements' Programming Software Development by javaLearner … not 'constructing' correctly??, i.e. public class ChatClientApplication extends Frame implements ActionListener, ItemListener, WindowListener and then: //Class constructor method.. public ChatClientApplication… extends JFrame implements KeyListener Programming Software Development by TheWhite ….JFrame; import javax.swing.SwingUtilities; public class Testing extends JFrame implements KeyListener{ public static void main(String[] args){ SwingUtilities.invokeLater(new… Re: extends JFrame implements KeyListener Programming Software Development by cbalu ….JFrame; import javax.swing.SwingUtilities; public class Testing extends JFrame implements KeyListener{ public static void main(String[] args){ SwingUtilities.invokeLater(new… Error in Implements on Java ME Programming Mobile Development by Nathan Campos ….rms.*; import javax.microedition.lcdui.*; public class simplecontacts extends MIDlet implements CommandListener, ItemStateListener { private Display display; private Alert alerta; private Form… write a C language program that implements the main functions of maintenance Programming Software Development by albanosali …;EMAIL SNIPPED> /// To write a C language program that implements the main functions of maintenance of student information. To maintain… Define a class which implements arithmetic with arbitrary precision Programming Software Development by svatstika … this book. One of them is: define a class, which implements arithmetic (+, -, /, *) with arbitrary precision. This is a new type with… Extending a class that extends a class and implements an interface Programming Software Development by Pyler … class KellyCoffee<Order extends Queue<Order>> implements OrderLineInterface{} Now when I try to implement `CheckOut` public class… Re: Extending a class that extends a class and implements an interface Programming Software Development by Tarek_2 Hi, `private class KellyCoffee<Order> extends Queue implements OrderLineInterface` Otherwise, the declaration seems wrong : a class can't extend herself. Re: Interface ... extends ... implements ... (Need help) Programming Software Development by masijade An interface cannot implement anything, since an interface is not an implementation. An interface can only extend interfaces (exactly one). Edit: PS If you are a David Eddings fan, it is spelled Belgarath not Balgarath. If not, then please ignore. Re: Interface ... extends ... implements ... (Need help) Programming Software Development by balgarath Thanks a lot...I didn't really need the Observer/Observable files anyway I can just make ToyFactory and ToyStore require those methods. David Eddings fan - yes, great books. I spelled it that way on purpose, used that name in Ultima Online years ago and it kind of stuck. Re: Interface ... extends ... implements ... (Need help) Programming Software Development by masijade [QUOTE=balgarath;464616]David Eddings fan - yes, great books. I spelled it that way on purpose, used that name in Ultima Online years ago and it kind of stuck.[/QUOTE] Just wanted to check that that was what it looked like. ;-) Re: '[Class] is not abstract..' error when i use 'implements' Programming Software Development by cosi Don't have the .class at the end. Just run the line java ChatClientApplication Hope this helps. ;-) Ed [QUOTE=javaLearner]Hi Ed, that's brilliant! Thankyou, code compiles now.. -> ha! So now of course I attempt to run it and get: ---------------------------------------------------------------------- [COLOR=Red][I]C:\Java … Re: '[Class] is not abstract..' error when i use 'implements' Programming Software Development by javaLearner Good point, thankyou Ed. Turns out I did not have my CLASSPATH environment variable set correctly ([FONT=Courier New][COLOR=Gray]set CLASSPATH=[/COLOR][/FONT]), so class files could not be found and nothing was able to run.. Thanks for help anyway.. :-|