Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Static TextField  RSS feed

 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to create a static textfield where I can enter a name in it and then switch to another panel (I'm using cardlayout) and display the same name in that panel.
Can I do this without storing the value of the textfield somewhere?
I tried something like
static Textfield myTextField = new TextField();
but it didn't work in both panels, only one.
Any ideas?
Thanks,
Drew
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use two textfield and transmit only the value. the overhead of two field instead of one won't be a problem for you?!
c
 
Jeremy Maddera
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have the two textfields share the same document object.....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!