Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
extends
- Page 1
How to Optimize RecyclerView performance by implementing the ViewHolder
Programming
Mobile Development
2 Weeks Ago
by Mikekelvin
…number of findViewById() calls. public class MyAdapter
extends
RecyclerView.Adapter<MyAdapter.ViewHolder> { public… static class ViewHolder
extends
RecyclerView.ViewHolder { TextView textView; public ViewHolder(View …
Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Weeks Ago
by jprog1000
… java.awt.Graphics; import java.awt.Color; public class BallPanel
extends
JPanel implements ActionListener { private int delay = 10; protected Timer timer…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Weeks Ago
by toneewa
… java.util.ArrayList; import java.util.Arrays; public class BallPanel
extends
JPanel implements ActionListener { private static final int delay = 16; protected…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Weeks Ago
by toneewa
… java.util.ArrayList; import java.util.Arrays; public class BallPanel
extends
JPanel implements ActionListener { private static final int delay = 1; protected…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Weeks 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 Weeks Ago
by Dani
I’ll mark this question solved :)
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Weeks 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 Weeks 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 Weeks 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 Week Ago
by jprog1000
Got it. Thank you so much!
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
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
1 Week Ago
by jprog1000
Great reply, vortex! Agree with all your points.
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
by aishamushtaq
Hi, Its helpful for me. I got my answer.
Re: Need for Inheritance in Java
Programming
Software Development
9 Years Ago
by Slavi
extends
keyword is part of the syntax showing that you are …
Re: FOnt changes in Jtree
Programming
Software Development
10 Years Ago
by mKorbel
extends
**JEditorPane** implements **TreeCellRenderer** - please whats goal, reason('s maybe), simple …
Re: Event handlers - Swing
Programming
Software Development
14 Years Ago
by masijade
"
extends
" is inheritance. Composition is using the base classes rather …
extends problem
Programming
Software Development
14 Years Ago
by kilermage
… class. Here is what the begining: [CODE]public class CombatHandler
extends
client {[/CODE] But when I compile I get this error… symbol symbol : constructor client() location: class client public class CombatHandler
extends
client { ^ Note: stream.java uses or overrides a deprecated API…
extends JFrame implements KeyListener
Programming
Software Development
15 Years Ago
by TheWhite
… javax.swing.JFrame; import javax.swing.SwingUtilities; public class Testing
extends
JFrame implements KeyListener{ public static void main(String[] args){ SwingUtilities…
Re: extends JFrame implements KeyListener
Programming
Software Development
15 Years Ago
by cbalu
… javax.swing.JFrame; import javax.swing.SwingUtilities; public class Testing
extends
JFrame implements KeyListener{ public static void main(String[] args){ SwingUtilities…
Interface ... extends ... implements ... (Need help)
Programming
Software Development
16 Years Ago
by balgarath
…rmi.Remote; import java.rmi.RemoteException; public interface ToyStore
extends
Remote implements Observer { String sayHi() throws RemoteException; public…rmi.Remote; import java.rmi.RemoteException; public interface ToyFactory
extends
Remote implements Observable { String sayHello() throws RemoteException; public…
Re: read or open any java file come after extends keyword in java?
Programming
8 Years Ago
by Mar. Na.
… e.printStackTrace(); } /////////////////////////////////////// //////open what come after
extends
keyword// try { String fileN = "C:/…B file/// package filename; class B
extends
A { public void f2() { …
read or open any java file come after extends keyword in java?
Programming
8 Years Ago
by Mar. Na.
… to read any file.java that come after
extends
keyword. public class CyclomaticComplexity{ public static void …e.printStackTrace(); }} } ////////////////////////////// ///filename program is public class filename
extends
B {public static void main(String[] args) { int s=9…
Re: Raw to <? extends Object>
Programming
Software Development
13 Years Ago
by ~s.o.s~
…no intermixing with legacy code). <?> same as <?
extends
object>. Even though <?> is a reifiable type… be any type or unknown supertype. Raw -> <?
extends
Object> unchecked conversion warning since Raw is a reifiable… type and <?
extends
Object> is not. Hence type safety is not …
Re: read or open any java file come after extends keyword in java?
Programming
8 Years Ago
by Mar. Na.
…access all classes related to my filename.java .. filename
extends
B And in the B class , there is …so on .... so When I read file that contain
extends
(inheritance)...count how many coupling classes associated with that …find how many inherited classes for example. . Filename
extends
B. . B
extends
A . ..so the coupling classes must be 2....
Re: Raw to <? extends Object>
Programming
Software Development
13 Years Ago
by yapkm01
…no intermixing with legacy code). <?> same as <?
extends
object>. Even though <?> is a reifiable type… be any type or unknown supertype. Raw -> <?
extends
Object> unchecked conversion warning since Raw is a reifiable… type and <?
extends
Object> is not. Hence type safety is not …
Re: read or open any java file come after extends keyword in java?
Programming
8 Years Ago
by Mar. Na.
But B is B.java and its exist in package filename ..so I want to open and read any file or class after
extends
keyword ..because also the B
extends
A class and also I want to read content of it and write it in an empty file....
Re: Raw to <? extends Object>
Programming
Software Development
13 Years Ago
by ~s.o.s~
…difference between <?> (Unbounded wildcard) and <?
extends
Objects> (Since Object is the highest upper bound … absolutely no difference between "?" and "?
extends
Object" [i]except[/i] for the fact that…whereas a parameterized type with a bound (List<?
extends
Object>) is not reifiable. Assigning [icode]List[/…
Re: Raw to <? extends Object>
Programming
Software Development
13 Years Ago
by yapkm01
… is absolutely no difference between "?" and "?
extends
Object" [i]except[/i] for the fact that parameterized…] ========================================================================================== What about from List <?> to List <?
extends
Object>? This doesn't generate a compiler unchecked conversion…
difference between extends and super
Programming
Software Development
11 Years Ago
by rahul.ch
List<?
extends
Integer> list = new ArrayList<Integer>(); for (Integer …(element); For the first three lines as Case 1 using
extends
it compiles fine. But for Case 2 of next three… says incompatible types. Found Object, required Integer. My confusion is *?
extends
Integer* being **anything that is an Integer or sub of…
Extending a class that extends a class and implements an interface
Programming
Software Development
10 Years Ago
by Pyler
… I've done it private class KellyCoffee<Order
extends
Queue<Order>> implements OrderLineInterface{} Now… implement `CheckOut` public class CheckOut<Order>
extends
KellysCoffee<Order>{} I get a bound mismatch… vlaid substitute for the bounded parameter <Order
extends
Queue<Order>> of the type …
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
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