What method? More needs to be done than change a method. Without a design coding is a waste of time.i
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 method? More needs to be done than change a method. Without a design coding is a waste of time.i
If you don't understand my answer, don't ignore it, ask a question.
design is sorted
Last edited by stresstedout; March 30th, 2014 at 06:21 PM.
What is the design for how the program should work? Decide on what the program should do before writing code.
If you don't understand my answer, don't ignore it, ask a question.
i would it to do as you suggested in post#4..
by design i am guessing you meant layout.. there in only one sentence and one draggable source in this code.
Last edited by stresstedout; March 30th, 2014 at 06:21 PM.
Does that code do what you want now?
What happens when you execute it?
If you don't understand my answer, don't ignore it, ask a question.
How are you testing it to see that it takes all draggable sources? What draggable sources are there in the program to test with?it takes ANY draggable source
If you don't understand my answer, don't ignore it, ask a question.
Those draggable sources are NOT in the code in post#29 that I was using for testing.
What are all the Strings in the constructor for the DropTargetTextArea class for in post#33? They were NOT in the code in post#29.
Why did you change that?
If you don't understand my answer, don't ignore it, ask a question.
this is t
Last edited by stresstedout; March 30th, 2014 at 06:21 PM.
Did you see my questions about the 4 Strings in the constructor? Why are they there? What does the class do with them?
If you don't understand my answer, don't ignore it, ask a question.
it relates to the drop label. i have 4 drop labels and in the DropTargetTextArea any four can be dropped.
if i add 5th drop label i will need to also add the string the the DropTargetTextArea for it to be dropped
What does the class do with the Strings that are passed to it?
What if there are 50 or 200?if i add 5th drop label i will need to also add the string the the DropTargetTextArea for it to be dropped
If you don't understand my answer, don't ignore it, ask a question.
im not sure, i have made a mistake.
what would i need to do to fix this?
What do you need to fix? What is the program supposed to do? What values does the DropTargetTextArea class need to have to do its job? What is the DropTargetTextArea class's job?
These are all questions that should have been asked and answered when the design for the program was made.
If you don't understand my answer, don't ignore it, ask a question.
Where is that label? I don't see one with those words in the text.the "cat jumped over the moon" label,
The drop location in the code is EMPTY, there is no text in it.
Yes, that sounds like what it should have and do.have 1 only string value which it will either accept or reject
Rewrite the code so it does that.
If you don't understand my answer, don't ignore it, ask a question.
JLabel s1 =
Last edited by stresstedout; March 30th, 2014 at 06:24 PM.
Each new drop target would be a new instance of the DropTargetTextArea class.if i was to add another 2 sentences how would i implement this?
If you don't understand my answer, don't ignore it, ask a question.
not sure how to implement this. please can you give me an example
Sorry, I don't know what you are asking for. What part are you having problems with?
If you don't understand my answer, don't ignore it, ask a question.
how do i do this??
Each new drop target would be a new instance of the DropTargetTextArea class.
Are you asking how to create an instance of a class? Use a new statement. The current code is full of them.
For example:JPanel gridPanel = new JPanel(new GridLayout(4, 4, 5, 5)); JPanel flowPanel = new JPanel(); ... Component droplabel = new DropTargetTextArea("moon", "dog","cat","mouse");
All those statements create new instances of some class.
If you don't understand my answer, don't ignore it, ask a question.
but i
Last edited by stresstedout; March 30th, 2014 at 06:24 PM.
You are correct, the code I posted was NOT how the code is supposed to be. I just copied some code from your last post to show you how you have used new statements many times in the code.i thought i was doing them wrong and thats why i took them out.
The constructor should have the String that the instance of the class will accept. Each instance can have its own String.
If you don't understand my answer, don't ignore it, ask a question.