• 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

Getting a variable value in a different JForm

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, i'm new to the site and i have a little problem with variable values. I have a username/password JForm that compares the input data in my textFields with my MySQL database. The thing is that my string (lets name it someString) gets the value from my textField when a button is pressed, but i can't return any value as actionPerformed is void type. If i declare it as an instance variable and use in my JForm2 as:

JForm1 jform=new JForm();
String temp=jform.someString;

i get the initial value, not the gathered from the textField.

I've tried with a method outside actionPerformed, but the result is the same. Any ideas?
Thanks!
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know what a JForm is, but in your example there isn't any process which involves the user keying data into a text field, at least not that I can see, so it isn't surprising that you get the initial value of the JForm's variable.
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic