Search Results

Showing results 1 to 40 of 94
Search took 0.01 seconds.
Search: Posts Made By: destin
Forum: Ruby Dec 12th, 2008
Replies: 1
Views: 1,794
Posted By destin
Yes, you need an internet connection...
Forum: Ruby Dec 8th, 2008
Replies: 1
Views: 1,740
Posted By destin
Use == to compare values; = performs assignment, not comparison.
Forum: Java Nov 20th, 2008
Replies: 2
Views: 416
Posted By destin
Your post did not get formatted correctly. Please edit it to use code tags.
Forum: Java Nov 11th, 2008
Replies: 5
Views: 448
Posted By destin
[QUOTE=VernonDozier;732999]
public void init ()
{
String stringWidth = getParameter("width");
String stringHeight = getParameter("height");
int width =...
Forum: Java Nov 11th, 2008
Replies: 5
Views: 448
Posted By destin
Applets shouldn't have constructors because an applet isn't guaranteed to have a full environment until init is called. So the code you would normally put in your constructor should go into the...
Forum: Java Nov 11th, 2008
Replies: 3
Views: 362
Posted By destin
This topic was recently discussed (http://www.daniweb.com/forums/thread155995.html).
Forum: Java Nov 10th, 2008
Replies: 3
Views: 484
Posted By destin
It's not just a convention, it's a good programming practice. If you incorrectly attempt to override a superclass's method without the annotation, your error will be silently ignored. If you do...
Forum: Java Nov 10th, 2008
Replies: 28
Solved: Weird Question
Views: 1,708
Posted By destin
Then I was correct in my last response.

Again, in Ruby, what you just described would look like this:
button_name = "button1"
eval(button_name).whatever # calls whatever() on the variable button1
Forum: Java Nov 9th, 2008
Replies: 3
Views: 440
Posted By destin
I'll go through each of the errors I see.

1) new int[5] //Constructing the array

This line does nothing useful and is missing a semicolon. You should remove the line completely.

2) int[0] =...
Forum: Java Nov 9th, 2008
Replies: 6
Views: 473
Posted By destin
You need to use the getWidth() and getHeight() methods.



Here's a rough draft of my version:
import java.awt.*;
import javax.swing.*;

public class GrowingBall extends JApplet {
...
Forum: Java Nov 9th, 2008
Replies: 28
Solved: Weird Question
Views: 1,708
Posted By destin
I still don't understand the question entirely, but in many scripting languages you can evaluate any given string as if it were code.

Example in Ruby:
var = "Hello, world!"
puts var # prints:...
Forum: Java Nov 9th, 2008
Replies: 4
Views: 402
Posted By destin
http://forums.devshed.com/java-help-9/java-help-plz-569400.html
Forum: Java Nov 9th, 2008
Replies: 28
Solved: Weird Question
Views: 1,708
Posted By destin
If you have two hundred buttons you should store them in an array.
Forum: Java Nov 8th, 2008
Replies: 28
Solved: Weird Question
Views: 1,708
Posted By destin
Java doesn't support creating variable names dynamically.
Forum: Ruby Nov 8th, 2008
Replies: 1
Views: 2,117
Posted By destin
Objects are destroyed for you by the garbage collector.
Forum: Java Nov 8th, 2008
Replies: 4
Views: 4,561
Posted By destin
You'd compare an object to null with ==. I think you want one of the following. It's hard to determine the exact behavior you're looking for from your code.
if (child == null)
child = new...
Forum: Java Nov 8th, 2008
Replies: 2
Views: 581
Posted By destin
Keep in mind you aren't looping here, so the sum variable is not doing anything useful.

You can rewrite javaAddict's code to be like this:
public static int myMethod(int counter) {
if...
Forum: Java Nov 8th, 2008
Replies: 10
Solved: Inheritance
Views: 827
Posted By destin
You can read more about it here (http://leepoint.net/notes-java/oop/constructors/constructor-super-example.html).
Forum: Java Nov 7th, 2008
Replies: 10
Solved: Inheritance
Views: 827
Posted By destin
You do need it. But it's there implicitly. It works because that superclass has a constructor that takes no arguments.
Forum: Java Nov 7th, 2008
Replies: 10
Solved: Inheritance
Views: 827
Posted By destin
We posted at the same time.
Forum: Java Nov 7th, 2008
Replies: 10
Solved: Inheritance
Views: 827
Posted By destin
A superclass must always be constructed before its children. There are two things that are implicit in your MainClass class.

1) Since you did not specify any constructors, you have an implicit...
Forum: Java Nov 7th, 2008
Replies: 3
Views: 1,092
Posted By destin
You have to compare each one explicitly.
boolean invalidColor = (FColour != 'B' && FColour != 'L' && FColour != 'W' && FColour != 'R' && FColour != 'Y' && FColour != 'G');
Forum: Java Nov 7th, 2008
Replies: 1
Views: 363
Posted By destin
Every class has a hashCode method. Just don't use the URL class for this because it's broken. use the URI class.
Forum: Java Nov 7th, 2008
Replies: 29
Views: 1,538
Posted By destin
No, reread what you/he wrote.

I'm not saying he was suggesting making it a public variable, just that in the context of his comment, he meant public variable.
Forum: Java Nov 7th, 2008
Replies: 2
Views: 339
Posted By destin
The java.util.Stack class is a legacy class. You should use the java.util.Deque interface instead, which supports LIFO.
Forum: Ruby Nov 7th, 2008
Replies: 5
Views: 2,912
Posted By destin
Try specifying the proxy in the gem command with sudo gem install rails -p [proxy url]:[port]. If that doesn't work, try setting the environment variable with set HTTP_PROXY=[proxy url]:[port]
Forum: Ruby Nov 6th, 2008
Replies: 5
Views: 2,912
Posted By destin
Do you have a firewall that's getting in the way?
Forum: Java Nov 6th, 2008
Replies: 5
Views: 924
Posted By destin
Is this just a syntax question? Because your psuedocode is (nearly) correct.
// MyObject is the class of the object you want to compare
public boolean(MyObject obj1, MyObject obj2){
if...
Forum: Java Nov 6th, 2008
Replies: 16
Views: 2,068
Posted By destin
Chances are he's doing it wrong.



Yes, in this case it does, but that's irrelevant to my point.


Right, but I was clarifying for the other posters since they thought that casting to a char...
Forum: Java Nov 6th, 2008
Replies: 16
Views: 2,068
Posted By destin
How do you know what format the OP saved his file in?


What? My point was that if you read in data from a file and get unexpected results (such as Asian characters, in this case) then you are...
Forum: Java Nov 6th, 2008
Replies: 29
Views: 1,538
Posted By destin
No, he meant public variable. He/she was saying that the OP should be saying myCircle.getRadius() instead of myCircle.getRadius (notice the parentheses). In the latter case, you would need to declare...
Forum: Java Nov 6th, 2008
Replies: 3
Views: 391
Posted By destin
The Math class is imported by default; you don't need to import it manually.
masijade was suggesting that you look in that class for a method that might be useful to you.
Forum: Java Nov 6th, 2008
Replies: 29
Views: 1,538
Posted By destin
Forum: Java Nov 6th, 2008
Replies: 6
Views: 473
Posted By destin
These should really be two separate threads, but that's alright.

Let's look at your applet first. There are a couple of problems with it. Mainly, you stuck all of your logic into the paint method....
Forum: Java Nov 6th, 2008
Replies: 6
Views: 473
Posted By destin
Can you edit your post to include code tags please?

your code here
Forum: Java Nov 6th, 2008
Replies: 16
Views: 2,068
Posted By destin
Yup, I edited my post a minute before you posted this.
Forum: Java Nov 6th, 2008
Replies: 16
Views: 2,068
Posted By destin
Beat you to it. :)

And to unconfuse you, read my post above and you'll see that an EOFException is an IOException.
Forum: Java Nov 6th, 2008
Replies: 2
Views: 684
Posted By destin
Try Googling "validating JTextField."

First result was your question covered in depth: http://java.sun.com/developer/JDCTechTips/2001/tt1120.html
Forum: Java Nov 6th, 2008
Replies: 16
Views: 2,068
Posted By destin
Note that IOException is a superclass of many classes (you can see a list at its documentation (http://java.sun.com/javase/6/docs/api/java/io/IOException.html)). If you put e.printStackTrace(); in...
Forum: Java Nov 5th, 2008
Replies: 2
Views: 1,092
Posted By destin
You have all the right logic, you're just missing half a line. Looks like a silly mistake on your part.
char c = word.charAt(0);
reverseWord += reverse(word.substring(1));
reverseWord += c;
Showing results 1 to 40 of 94

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC