Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextFields, ActionListeners and multiple Classes  RSS feed

 
Mike Drozz
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how would I access the text from a textfield in a gui class at the click on a button and send that info into my actionlistener class?
The current error i get is "salary has private access in java.awt.Component"
This is the actionlistener class (not complete yet)


This is PART of the Gui class, and the tabbed pane where the JTextField reside. (only the parts that count)


[ September 02, 2003: Message edited by: Mike Drozz ]
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know the reason, but this line looks strange:
String getName = (JTextField) GuiInfo.name.getText();
I won't have thought that the compiler would allow a String to be cast to a JTextField.
 
Mike Drozz
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yea i changed that already, got any suggestions on how i can make this work?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!