Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Observer/Observable

 
Andy Rayner
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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--
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic