Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
actionevent
- Page 1
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
5 Days Ago
by jprog1000
Got it. Thank you so much!
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
4 Days 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
4 Days 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
3 Days Ago
by Digital_39
Hi, Its helpful for me. I got my answer.
Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
by jprog1000
…java.awt.event.ActionListener; import java.awt.event.
ActionEvent
; import javax.swing.JPanel; import javax.swing.…new Timer(delay, this); timer.start(); } public void actionPerformed(
ActionEvent
e) { repaint(); } public void paintComponent( Graphics g )…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
by toneewa
…java.awt.event.ActionListener; import java.awt.event.
ActionEvent
; import javax.swing.JPanel; import javax.swing.…new Timer(delay, this); timer.start(); } public void actionPerformed(
ActionEvent
e) { repaint(); } public void paintComponent(Graphics g) {…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
by toneewa
…java.awt.event.ActionListener; import java.awt.event.
ActionEvent
; import javax.swing.JPanel; import javax.swing.…new Timer(delay, this); timer.start(); } public void actionPerformed(
ActionEvent
e) { repaint(); } public void paintComponent(Graphics g) {…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week 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
1 Week Ago
by Dani
I’ll mark this question solved :)
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week 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
1 Week 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
1 Week 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());
ActionEvent for multiple JButtons
Programming
Software Development
12 Years Ago
by DoubleGee
… buttons work. Here is my actionPerformed method: public void actionPerformed(
ActionEvent
evt) { if(evt.getSource().equals(printButton)) // This is the first…
Re: ActionEvent for multiple JButtons
Programming
Software Development
12 Years Ago
by DoubleGee
…. Any suggestions what the problem might be? public void actionPerformed(
ActionEvent
evt) { if(evt.getSource().equals(printButton)) { System.out.println(inResult…
GUI Actions With Objects, ActionEvent ActionListener
Programming
Software Development
13 Years Ago
by kezkez
… like ... class Action2 implements ActionListener { public void actionPerformed (
ActionEvent
e) { String record1 = field2.getText(); String record2 =…,400)); } class Action implements ActionListener { public void actionPerformed (
ActionEvent
e) { String newDatabaseName = field1.getText(); StudentDB db =…
Faking An ActionEvent
Programming
Software Development
13 Years Ago
by ajst
… currently have a method that is called on a
ActionEvent
of being clicked. Now I want to call that … want to call. [CODE] private void gameEndTurnBtnActionPerformed(java.awt.event.
ActionEvent
evt) { if(theGame.WhosTurn() == 1) { theGame.SetWhosTurn(2);…
If statement non functional in button ActionEvent
Programming
Software Development
9 Years Ago
by shayan_doust
… java.awt.event.ActionListener; import java.awt.event.
ActionEvent
; import javax.swing.*; import java.awt.event.*; public…(true); button.addActionListener(new ActionListener() { public void actionPerformed(
ActionEvent
e){ if(parseduserguess > numberToGuess){ result.setText("…
Re: If statement non functional in button ActionEvent
Programming
Software Development
9 Years Ago
by Heanre
…awt.event.ActionListener; import java.awt.event.
ActionEvent
; import javax.swing.*; import java.awt.…); button.addActionListener(new ActionListener() { public void actionPerformed(
ActionEvent
e) { int numberToGuess = rand.nextInt(100); int…
Re: actionListener & actionEvent in diffirent classes
Programming
Software Development
13 Years Ago
by Dean_Grobler
… normaly you do that and then you have a method
actionEvent
/actionPerformed method in the same class that then says what… is clicked. What I want to do, is have this
actionEvent
/actionPerformed method, in ANOTHER class. Make sense?
Re: Faking An ActionEvent
Programming
Software Development
13 Years Ago
by JamesCherrill
Since your method's code doesn't actually use the
ActionEvent
parameter, you could just call gameEndTurnBtnActionPerformed(null); from anywhere in your class (or anywhere else if you make it public).
Re: Faking An ActionEvent
Programming
Software Development
13 Years Ago
by ajst
… needs to know [CODE] private void gameEndTurnBtnActionPerformed(java.awt.event.
ActionEvent
evt) { if(theGame.WhosTurn() == 1) { theGame.SetWhosTurn(2); theGame.ResetMoved…
The e.getSource() method from ActionEvent e in a listener
Programming
Software Development
14 Years Ago
by mastr924
In the listener for a button in the actionPerformed(
ActionEvent
e) part, if you call e.getSource it returns a type object. So how can I turn that object that it returns into the original button?
actionListener & actionEvent in diffirent classes
Programming
Software Development
13 Years Ago
by Dean_Grobler
Hi there, I just wanted to find out if one can have a actionListener() in one .class file and then have the
actionEvent
() in another .class file? If not, how would I go about to get the same effect? Thanks!
Re: actionListener & actionEvent in diffirent classes
Programming
Software Development
13 Years Ago
by JamesCherrill
This question doesn't quite make sense - the
actionEvent
is created by Swing normally. Can you please explain exactly what you want to achieve?
JFrame Code
Programming
Software Development
8 Years Ago
by hadisur_rahman
…lt;/editor-fold> private void memoryreadActionPerformed(java.awt.event.
ActionEvent
evt) { display1.setText(String.valueOf(memorydisplay.getText())); } private void onedividedbyxActionPerformed…
Help with subtotal
Programming
Software Development
14 Years Ago
by onlinegear
…TableList.addActionListener(new ActionListener() { public void actionPerformed(
ActionEvent
event) { } }); //Order 1 numberLabel1 =….addActionListener(new ActionListener() { public void actionPerformed(
ActionEvent
event) { if (DrinksCombo10.getSelectedItem().equals("…
Need guidance
Programming
Software Development
16 Years Ago
by nljavaingineur
…{ this.adaptee = adaptee; } public void actionPerformed(
ActionEvent
e) { adaptee.button15_actionPerformed(e); } } class … { this.adaptee = adaptee; } public void actionPerformed(
ActionEvent
e) { adaptee.button1_actionPerformed(e); } } } class …
Currency Conversion
Programming
Software Development
13 Years Ago
by Matt89
…} private void ZeroActionPerformed(java.awt.event.
ActionEvent
evt) { Money.setText(Money.getText()+Zero… private void EightActionPerformed(java.awt.event.
ActionEvent
evt) { Money.setText(Money.getText…
need help wth java calculator app
Programming
Software Development
11 Years Ago
by darylglenng
…(jTextField1.getText()+B3.getText()); } private void B5ActionPerformed(java.awt.event.
ActionEvent
evt) { jTextField1.setText(jTextField1.getText()+B5.getText()); } private void B6ActionPerformed…
parent/child
Programming
Software Development
16 Years Ago
by ceyesuma
…private void crnewacctActionPerformed(java.awt.event.
ActionEvent
evt) { if(evt.getActionCommand()==("…} private void CreditActionPerformed(java.awt.event.
ActionEvent
evt) { // TODO add your handling…
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