Hi, i'm trying to understand this program. I got the drawing part and converting the brush strokes into packets. but i don't get the connection part. (Ultimately when i compile the program nothing comes out. it only displays: Usage: java Draw <my port> <remote host> <remote port>. could someone please verify what is wrong? Million thanks for the help.
As for the connection code i don't get is:
What does this do?
i see. thanks for trying it out for me.
i'm not quite sure but is this written in an internet form or a local form....
what if i want to change it such that it connects to a localhost instead...which part should i change?
after i compile and run it using jCreator it shows
nothing comes out even after i enter the port,remote host and remote port...
the code should be working i think as when i got it i was told it was working and taken from a class lesson.
Thank you for your help and patience! after posting the question i kinda figured it out and tried it however it did not work...i even created another Draw file and renamed it and tested it. but it still won't send....
could you do me another favor by testing it out please?
I already did, and hinted that you would have problems with the application early on in the thread.
You DO NOT need to rename or copy anything, simply start two Draws in two different windows
with different parameters, as I've already (patiently) told you.
What are you trying to do?
Do you know Java? I get a sense you are quite new.
Yes, I've tested it, and changed the code to make it work. I can draw in one window and see it in another.
Is this an assignment, a test of some kind to make this work?
For example:
Look carefully through the run() method. Do you see anywhere that message is actually populated with a String??
NO! It's null! and split() throws a NullPointerException!
I do, can and will help, but you have to be honest here as to your capabilities.
sorry for not stating what i was trying to do at first. Little introduction on my situation:
I know java but i'm not that good in it. i've learned C++, VB, HTML,PHP within 1 year a few years ago in school. The school didn't really care about our knowledge as long as we managed to pass.
End of last year I started JAVA classes(as required by my school) Recently(within this year) I've been given JAVA assignments to do and managed to complete. All which were object oriented programming. All which i did through trial and error(and which was relatively easy), my grasp of JAVA(and other programming) is not good. If the code is easy(doesn't point here and there) i will understand. I've relied on Head-First JAVA book to pass so far.
This is an assignment for a subject called Operating Systems and Networking.
Part 2 of the assignment actually.
Part 1 required me to create a simple instant messenger which i managed to.
Part 2 requires me to select a more complex networking program. I have options, to code it myself(which has extra credit) or to take it from the net(which has less credit, which i intend to do) but to give reference to it. Then i will have to write a detailed report on step by step how does the program work. The reason i ended up doing something like this(whiteboard) was because i was given such a title. The title however, i find is too complex for me. Other titles were taken by my other classmates. I can't appeal to the school because its holiday now. The code was given to me by someone who found it online from some academic archive.
thanks for the help so far, really appreciate it and i hope you will be able to continue to help me.
Edit: i was not aware that Draw doesn't work until you told me.
There are 2 diff types of deliverable (verbally told by the teacher at least) the teacher is giving us leniency as she knows our programming is weak and we were not scheduled to take this subject until we completed a subject called Data structures or something....but the time table changed and we ended up taking the networking subject first.
Anyway back to the deliverable:
Case 1
If the student wishes to write the code on his own. the code will be ran through a system to check for plagiarism online. If none is found the student is then interviewed by the teacher to ask him to explain the code. eg.like what does this part of the code do? how did you achieve this? if no folly is detected then the student gets marks and doesn't need to write a report.
Case 2(the lenient one)<<the one i'm choosing
If the student can't produce the code himself, he can get it from the internet or the library. However, by doing this the student forfeits a portion of marks and is required to write a report explaining in detail (to prove) that the student understands the code. Edit: the report is an essay.
I found other examples of these type of whiteboard programs but they are even more complex....some are even complete with login systems and broadcast to many users.
I asked the classmate who gave me the code. he gave me the link where he got it from. http://people.dsv.su.se/~vero-rar/java/Draw.java which i am shocked as i don't know what language is that...
Post by:autobot
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
a bit of art, as a gift, that will fit in a stocking