This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help connecting jButton to jText using Forte

 
Daryl Jonescheit
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, here's what I want to happen in my Swing Applet.
I have a jButton called makeConnectionButton.
I have a jText called makeConnectionText.
I have a method in a different class called makeConnection.
When I click the button, I want it to call the method makeConnection and return output to makeConnectionText.
Sounds simple, but for some reason I'm befuddled.
I was able to get my clear button to clear the text from all of the text components by changing the property of text to "". Is this appropriate or should I have used a method to do it.
Any help would be greatly appreciated..
Daryl
[ February 08, 2002: Message edited by: Daryl Jonescheit ]
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this sounds more like a Swing/AWT question and not an IDE issue, I'm moving it to that forum where it will be better addressed.
Personally, that's the way I always get my text fields to clear. Make a method called clearFields() that's called when you press the clear button.
Jason
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I would do is return an Object back from your makeConnection() method. For instance, if you just wanted to return a String do this:

Then your makeConnection() method would look something like this.

As far as clearing your textFields, that is the method I always use.
Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic