what am i doing wrong ?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
what am i doing wrong ?
Last edited by stresstedout; March 30th, 2014 at 06:20 PM.
Please explain.what am i doing wrong ?
What is wrong? If you get error messages, copy the full text and paste it here
If you don't understand my answer, don't ignore it, ask a question.
is this correct in regards to post#50?
Last edited by stresstedout; March 30th, 2014 at 06:20 PM.
NO. It was partly correct in post#29
Also the droplabel arg passed to the constructor is not used.this.droplabel = "moon"; // this value lost on the next line this.droplabel = "mouse"; // THIS destroys what was saved above
I don't know how you can code like this. These are absolute beginner's mistakes.
If you don't understand my answer, don't ignore it, ask a question.
now im really confused.
The program should pass the String to be accepted to the constructor like was done in post#29.
Yes, I think you are. This program continues to be past what your knowledge is capable of.now im really confused.
If you don't understand my answer, don't ignore it, ask a question.
yea u right im not best otherwise i wont be looking for help. but im sure i will understand it may take some time but im nearly there so can you help me or not?
Look at post#29. Copy how it passed a String to the constructor for one instance of the class.
If you want different drop targets that use different Strings, use the new statement like in post#29 to make new instances of the drop target each with its own String.
If you don't understand my answer, don't ignore it, ask a question.
is this correct? plain how i made a different drop target with its own string?
Last edited by stresstedout; March 30th, 2014 at 06:20 PM.
NO. There is no need for an array for a single value. Just save the String in a class level variable.
Where is string2 defined? You should compile the code before you post it so you can also post any error messages that the compiler writes.
Use the new statement to create different instances:how i made a different drop target with its own stringDropT dt1 = new DropT("string1"); // one drop target with its own String: string1 DropT dt2 = new DropT("secondString"); // another drop target with its own String: secondString
If you don't understand my answer, don't ignore it, ask a question.
i have this error:
these are lines of code
Last edited by stresstedout; March 30th, 2014 at 06:20 PM.
Please explain what string2 is supposed to be used for.public DropTargetTextArea(String string1, String string2) {
BTW string1 and string2 are poor names for variables. Variable names should describe the values that the variable holds.
What is in string1 and in string2?
If you don't understand my answer, don't ignore it, ask a question.
public DropTargetTextArea(String moon) {
sorry i forgot to take out string 2
so its:
is this correct?
Last edited by stresstedout; March 30th, 2014 at 06:19 PM.
That was a big waste of time.sorry i forgot to take out string 2
Why is the arg named: moon? That is a strange name for a variable.
What are these lines of code for?Do they compile without errors?DropTarget dt1 = new DropTarget("moon"); DropTarget dt2 = new DropTarget("");
If you don't understand my answer, don't ignore it, ask a question.
no i just ran it has errors
OK, I'm done for tonight. Back tomorrow.
If you don't understand my answer, don't ignore it, ask a question.