Bookmark Topic Watch Topic
  • New Topic

How do I output the results of a resultset to text area that is in another class with a gui?  RSS feed

 
marsha bianco
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
//calling method in a subclass



I understand I did not iterate through resultset yet, but I am more concerned about outputting to textarea from another class:
All the new instances of GUI are to get around calling static from non-static context. How can I fix this output issue, and if there are any other major problems, please feel free.
 
Campbell Ritchie
Marshal
Posts: 56521
172
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please use the code button. Since it's your first post with code, I'll edit it and let you see how much better it looks.

Why have you got the bit about new GUI() in the catch block? That looks very very peculiar and almost certainly a big mistake. Even worse, you are re-declaring it. So you have a variable local to the catch block, which goes out of scope thereafter.

Don't try too much at a time. Divide it into small bits. Can you get that code to work from the command-line without a GUI? Do you get a correct output there? Don't try anything with a GUI until you get a correct command-line print-out. Why are you trying to get the values by parsing the different text boxes, rather than from your result set?

Have you worked out the difference between static members and instance (=non-static) members? I think you need to work out that difference before trying anything, otherwise endless confusion awaits you . . .
 
Janeice DelVecchio
Bartender
Posts: 1812
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Duplicate thread: http://www.coderanch.com/t/510616/java/java/Unable-output-ResultSet-JTextArea-separate

Please use one thread per topic.... that way we can keep track of the conversation.

Locking thread. Please continue conversation in other thread.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!