You need to create an Object that encapsulates those variables. It doesn't make sense to add all of them to the List at once- you need to put them into an Object, then add that Object to the List.
Type: Posts; User: KevinWorkman
You need to create an Object that encapsulates those variables. It doesn't make sense to add all of them to the List at once- you need to put them into an Object, then add that Object to the List.
http://www.java-forums.org/new-java/78517-trying-build-hash-table-getting-null-pointer-exception-search.html
I'm not sure what you want us to do. You haven't posted an SSCCE for us debug, and you say you can't debug it yourself. That's going to make debugging it pretty hard, don't you think?
If you can't...
I read this reply, and it doesn't ask a question.
You need to be more specific- the tutorial I posted tells you exactly how to obtain a Graphics instance to draw with, and how to setup an...
Well, what is the KnopHandler class?
Also, that syntax is incorrect. What are you trying to do here:
zwart.addActionListener(kh)(
new ActionListener(){
public void...
I would actually recommend starting out in something like Processing. It makes your life a lot easier and teaches you Java syntax. Once you understand the basics you can work your way up to Java and...
Recommended reading: Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)
See how you save the diameter to a value named d, which you change using a JSlider?
You can do the same thing with a Color variable:
Color c = new Color(255, 0, 0); //Color.RED
g.setColor(c);...
You're right; there isn't much code required. But we can't just do your homework for you.
You already use a JSlider to change the diameter of the circles. Changing the colors would be done in a...
You can add any Object to an ArrayList, including other ArrayLists. What have you tried?
Everything you've asked (how to resize an array, how to import an ArrayList, now this) is pretty basic. If...
I recommended taking a step back because it sounds like you don't really have a solid grasp of the fundamentals just yet- how to create a menu, how to create a button, how to pause the game or render...
You've been warned about cross posting before. Why would we waste our time if you don't take our advice anyway?
I've already provided some suggestions and asked you a question that you seem to be...
A ribbon is just a collection of JButtons. You can specify your own renderer for a JTree.
Which part of this is giving you trouble?
--- Update ---
Nevermind, I see I'm wasting my time.
...
Use the highlight tags by checking out the forum rules you were linked to upon joining, or by quoting another post that uses them to see how they work.
More recommended reading: A Visual Guide to...
Please use the highlight tags to preserve formatting. Unformatted code is pretty hard to read.
Recommended reading: http://docs.oracle.com/javase/tutorial/uiswing/components/button.html
It sounds like you're biting off a bit more than you can chew. I recommend taking a step back and really wrapping your head around all the concepts you're trying to use. When you talk about a menu,...
You need to do some troubleshooting. Where exactly is the problem? You've got a few different things happening, so you have to narrow the problem down. Does the first program exit without any...
Please post an SSCCE demonstrating exactly what you're doing, as it's hard to tell the problem from a single line.
If I had to guess, I would say it sounds like you're missing an import statement,...
Guys, please stop trying to do his homework for him- Gary, the advice you offered is incorrect.
The problem lies in the parameters being passed into the recursive call. It's not helpful to simply...
Vector is synchronized, so I could see an argument for preferring it over unsynchronized ArrayLists. You can modify the Vector that you pass in to the JList constructor, since the constructor just...
When posting code, please use highlight tags.
What happened when you stepped through this with a debugger, or at least added print statements?
Hint: What is the value of start each time the...
Please use the highlight tags when posting code.
What's stopping you from using an ArrayList? They've been around since 1.2.
If you're asking how to resize an array, a general way to go about...
I'm not really sure why you think that means a more direct approach won't work. Just put the time addition code in the check for whether a player has been killed. No need for convoluted threading.
This seems like a really roundabout way to accomplish your goal. Why don't you just record the player's start time and then figure out the remaining time from that?
//init
long startTime =...
Check out the Swing tutorials.