- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- PC Specs
- I know basic Java and very basic C
15 Posted Topics
Re: What kind of error? EDIT: Oops, hadn't seen JamesCherrill's post | |
Hey guys, I'm working on a game, and I was trying to mirror the gif images inside the program so I wouldn't have to do it manually (And also so it wouldn't use twice as much space to store the mirrored gifs). Anyway, I Google'd it and found [URL="http://stackoverflow.com/questions/1708011/create-a-imageicon-that-is-the-mirror-of-another-one/1708909#1708909"]this answer[/URL], … | |
Re: check out the deepEquals method of the Arrays class. | |
EDIT: My problem was solved. :) But I have a doubt, what is the most effective way to wait for something to happen in java? for example, if I want to wait for a boolean b to be true, does this below work? [CODE=java]while(!b) {} //stuff to do after wait … | |
Re: I once had to do a program like this for a test, but in C, with 16 teams. The logic I used was like this, I made a class (actually in C, it's struct, but I'll say everything as if it was Java) named Team and that class had a … | |
Re: Have You learned about event listeners? Check out ActionListener at the Java API, that's the class used for getting button clicks. | |
Re: Could you please post the Player class and show how you override the toString() method? :) In line 55. there's something seriously wrong... [CODE]System.out.prinsome small issuestln("Please enter player's points scored: ");[/CODE] To remove a player, you could look in each player in the player ArrayList, and check which one has … | |
Re: Actually, the loop will be executed 3 times, one for j=0, so x=x*j=1*0=0, then for j=1, so x=x*j=0*1=0, and then for j=2, so x=x*j=0*2=0, and then it will print 0 :) | |
I'm creating a silly game, and the first thing I want to make is to tell you "You Lose" if the all that you control with the mouse is not inside the frame. I created a JComponent and every 20 milliseconds it is repainted (A thread does that). Inside it, … | |
Re: Shouldn't your String be initialized like this? [CODE=java] String companyName = "Event Handlers Incorporated"; [/CODE] | |
Re: Just as JamesCherrill said, your actionPerformed should look like this [CODE=java] public void actionPerformed (ActionEvent e) { if(e.getSource()==button1) { //do stuff } if(e.getSource()==button2) { // do other stuff } } [/CODE] | |
Re: I don't usually extend JFrame or implement ActionListener (You forgot to put the first "A" in Upper Case, and Java is case sensitive), but this is what your code could look like [code=java] package OneButton; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.util.*; public class FirstButton extends JFrame { public … | |
Re: I think the attachment will help you. I read a book about Java and it talked about this, so this is the code to do it. The program uses recursion to divide the array into two and use the pivot to put the bigger numbers in one side, and the … | |
Hi everyone, I'm trying to create a program that you can use to communicate to other people with the same program. It connects to a Server program that gets your message an send it to everyone. I found 2 problems that I haven't been able to solve. The first one … | |
Re: You should use an Employee class for each employee, there's no need for one that holds all of them, and then you won't need arrays int the Employee class. |
The End.