1,678 Posted Topics
Re: System.out.println("ERROR! FLAGRANT WINDOWS ERROR!! Dunno what you did, mate, but you sure screwed things up over here! You're lucky I don't throw the Blue Screen of DEATH at you!! Now enter a positive number!!!(Greater Than 0)"); //print error message1 Haha. I have to say you have a great sense of … | |
Re: Your question makes no sense. Please re-explain & give code also. | |
Re: cgeier already showed you how to get input from the user and how to store that value into a variable. And you'd calculate using the get methods, if anything. That's why it's called "get". You can't calculate anything by using a set method, because set methods by definition are there … | |
Re: Well, what is the size of your array when it draws two lines next to each other? Is it one, or two? Do some debugging. If the array's size is two, then no wonder it looks like that. If its one, my theory is kaput, but have you even made … | |
Re: We're not going to write it for you so show us some effort and explain why you need help/ what exactly you need help with. | |
Re: Is your program actually calling repaint? I see no debugging... anywhere. | |
After compiling the code found [URL="http://beej.us/guide/bgnet/output/html/multipage/clientserver.html#simpleclient"]here[/URL], I immediately got a number of errors. (Unfortunately, Beej is the starting point my instructor suggested to implement our FTP client's "minimal" commands, but that's another story). Anyway, I got rid of a few of them, then ran into this: [CODE]client.c:32 - error: storage … | |
Re: [url]http://lmgtfy.com/?q=dead+lock+java[/url] That question has been asked and answered. You don't have to look past page one of google to find a sufficient answer. | |
Re: If you start the two threads from within the same class I don't see why they wouldn't be able to both access that variable if the variable is a class variable. You could also pass the variable to both threads through some constructor or method, or you could use a … | |
Re: You [I]decompiled[/I] them? Implying the source code wasn't yours, and we don't give help with reverse engineering. | |
Re: Well. . I'm in the U.S., I've had one internship, haven't graduated yet, and accepted 73k starting for when I graduate . . so I guess it depends on how much a Masters degree is worth. But also keep in mind that benefits can mean a whole lot. So if … | |
Re: Yes, and they answered your question already. The reason it isn't working is because [CODE=Java]Node trailer = new Node("","",null, null);[/CODE] is invalid because "" and "" are Strings. You did not write a constructor method that takes two Strings followed by two Nodes. Your constructor takes a double, an int, … | |
Re: I'm confused - you said you're creating some sort of "binary tree priority queue" but your code looks like it's just intended to be a sorted list of Objects, which are different. Which is it supposed to be? Also, in your sample run, you added a /4 but it doesn't … | |
Re: If you want to implement the hangman images, you should actually use different images, and simply redraw the appropriate image every turn. (i.e. we did hangman for the iphone in my iphone programming class. You can take the images from [url]http://cs491f09.wordpress.com/2009/10/14/assignment-5/[/url] if you want). Based on how many guesses the … | |
Re: I'd start by booting into safe mode and restoring to before you deleted something you obviously shouldn't have. Then get proper virus removal software and use it. | |
Re: Haha funny. Read our stickies and go away. Also, while you're wasting our time, shameless plug for anyone to level this -vote out: [url]http://www.daniweb.com/forums/search542099.html[/url] edit: Thanks :) | |
Re: You can't add slots to an array. It's impossible. You can create a new array with 5 more slots however, and copy in the contents. Although I hope an instructor didn't tell you to do this because it is a bad idea - instead, double the size of the array. | |
Re: [CODE=Java]stringCensor theCensor = new stringCensor(); // a new stringCensor is constructed String censored = ""; // censored is initialized to a null string System.out.print("Enter your string: "); // user prompted to enter the string String whatTheUserPut = input.nextLine(); theCensor.userString(whatTheUserPut); [/CODE] You need to put that entire section of your code … | |
Re: [CODE=Java] CarV5 car1 = new CarV5(String carType1, double endMiles1, double startMiles1, double gallonsUsed1, double pricePerGallon1); { cT1 = carType1; eM1 = endMiles1; sM1 = startMiles11; g1 = gallonsUsed1; ppg1 = pricePerGallon1; }[/CODE] It's because the above code does not have valid syntax. Are you trying to create a method? If … | |
Re: What is a "website major"? ... Never heard of that one. Anyway, I'll be more specific since I'm feeling nice today, even though Ezzaral gave you more than enough to figure it out. 1. Create two variables - if the user has to be able to enter integers, then use … | |
Re: Alright, when is the due date though? I need to know if I have enough time to do this as well as my own less important assignments. | |
Re: What does creating an algorithm have to do with C#? I was unaware that algorithms were language specific. | |
Re: Paste us the error with the line number it's occurring on. Once you do so it'll make it easier for us to help you. :) | |
Re: No, we can't code for you. If you want help ask a detailed question. And if you have no idea at all where to start, start by reading about 2D arrays and think about how they can aid you in creating your "world". | |
Re: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer[/url] You said javadocs.. have you looked at the swing tutorials though? Using a custom renderer for a JList is done the same way as using one for a combo box, according to those tutorials. I haven't personally attempted it though, and I never will. If you can get the … | |
Re: If you want to create a jar very easily, one way you can do it is by using the Eclipse IDE. To create a jar in eclipse, file-> export -> Jar File (this might be listed under 'java' -> next, and under manifest class you would select the main class … | |
Re: Your question has been asked and answered around a thousand times online. If you want the exact code, find it on google. Otherwise read this, it explains the answer. [url]http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html[/url] | |
Re: In addition to what raven said, computer graphics is an obvious one. Might want to take GUI programming as well. | |
Re: So what do you need help with? Have you tried it yet? Try it and post what you've got and we'll help. | |
Re: nextInt returns an int, you need to store it at some index in your temp array. You didn't specify an index to store it into. temp[0][1] is an index, temp[][] is not. | |
Re: This belongs in a normal thread, not in a code snippet. And I've experienced the same problem in the past, but I did a lot more debugging than you did. For example, when the window is resized, is your paintComponent method called? | |
Re: Nobody is going to do your homework for you. You will only receive help here if you show effort on your assignment. | |
Re: Your statement on line 21 does nothing because 'gallons' is 0. Saying gallonsused++ adds one to gallonsused. Inside your while loop, what you want to be doing is saying gallonsused = gallonsused + gallons. (Or, equivalently, gallonsused+=gallons). You also only need to prompt the user for the gallons used once … | |
Re: You can 'wrap' the array by creating a new Float[] array and then in a for loop, add each float primitive type to the Float array. | |
Re: Yes, it works, but like firstPerson said just try it next time. You could also use public static float afp = (float)2.34; //or any decimal value | |
Re: Nobody is going to write anything for you. Especially when that description made no sense to begin with. But read the rules and go away. | |
Re: [CODE=Java]Character ch = new Character('\u00C3'); char prim = ch.charValue(); System.out.println(prim);[/CODE] Something I just learned how to do after a quick look up in the Character class documentation. I'm sure if you read some stuff yourself and try some things out, you'll find many more useful methods. [url]http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html[/url] | |
Re: I already provided an answer in the thread you made in the Java forum. But logically n! < n^n and log(n^n) = n log n. | |
Re: They're being removed because you said [CODE=Java]if(Balls.get(X).intersects(Balls.get(Y)) == false) { Balls.remove(X); }[/CODE] That doesn't make logical sense to me. It should be if that == true, then remove one. It's going to be false almost all the time. Your statement removes X every time X and Y [I]don't[/I] intersect, whereas … | |
Re: No, I've never played. I prefer simple games like connect four :) And apples to apples is a very fun "relaxed" drinking game | |
Re: In addition to what Peter said, you might find some of the responses here helpful: [url]http://www.daniweb.com/forums/thread232056.html[/url] | |
Re: For continuously doing [I]anything[/I] you can use a while loop. Look into the Scanner class for reading in user input. Use System.out.println to provide them with a prompt where they can say whether or not they want to continue. And for insuring that values are Integers, you can look at … | |
Re: Tenchi, your problem with the nextLine() not working is the same problem I recently explained to another user on Daniweb. I'll paste my response to him here since the problem you have is exactly identical. "The reason it gives you trouble is because when the user enters an integer then … | |
Re: I actually don't understand the pattern. Enlighten me. | |
Re: Because q+3 is longer than the total length of your rS array. You cannot access an array at an index longer than it's largest index. This is probably because your 'max' variable isn't a good indicator of rS's length (you are using 'max' as a bound on how large q+3 … | |
Re: Just modulus (%) by ten. That will give you the last digit. | |
Re: You need a for loop, not an if statement. [url]http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.html[/url] You need to declare two integer variables outside of your for loop. One to keep track of the total amount of money earned, and one to keep track of the amount you need to add next time. For example, the … | |
Re: What is your question? You didn't specify any portion of the code that you want us to look at. Do you just want us to give you random number generating techniques in general, because for that, you can use google. | |
Re: In actionPerformed, you create a new "Login", [I]not[/I] a new "Log". Why didn't you post your Login class? (Post it :) ) PS: It seems to me from the way that you created a new "Login" and then called a method identical to one I see in the Log class, … | |
Re: No guarantees, but I read through this thread and it might shed some light. Of course, it is a C++ thread, but it is on the same exact topic (the OP there also claims the clock is always returning 0). One of the suggestions there is to try to increase … |
The End.