• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help connecting jButton to jText using Forte

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic