aspose file tools*
The moose likes Beginning Java and the fly likes Observer/Observable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Observer/Observable" Watch "Observer/Observable" New topic
Author

Observer/Observable

Andy Rayner
Ranch Hand

Joined: Dec 09, 2004
Posts: 36
Hello im having a few problems using the Observer Observable,
I have these classes so far

Model - kicks off two threads for input and output
Input - input from the keyboard
Output - output from the server
ViewClass - the GUI

at the moment in the output i use a bufferreader which gets each character the server gives and outputs it to the terminal, i am wanting to display this in a JTextArea using the observable
so i do this in the Output class


c is a char which holds a character representation of the int fromServer.read() //from server been the bufferreader
i then convert the char into a string and send it to a method in the Model(m) called set text.

in the model i have


for some reason i am getting this error message

----jGRASP exec: java Harness

java.lang.NoSuchMethodError
at OutputStream.run(OutputStream.java:37)

----jGRASP: operation complete.

Hope you can help me with this
many thanks again
Andy
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The error message indicates that the problem occurs on line 37 of OutputStream.java. Is this your own class called OutputStream or is it the OutputStream from the standard Java IO package?

Layne


Java API Documentation
The Java Tutorial
Dale Seng
Ranch Hand

Joined: Mar 22, 2004
Posts: 275
I'm not so sure I'd call spinning off threads a beginner question.

But for sure, you would need to post more than snipets to get an answer, like maybe identify line 37 of your failing code (assuming that is your code and not from the IO package).

--Dale--
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Observer/Observable