How do I pass a Text field value from one jFrame1 to jFrame2
- From: dewan.islam@xxxxxxxxx
- Date: 28 Nov 2006 02:36:08 -0800
I have been trying to solve this for the past 4 hours, so any pointers
would be helpful.
Problem: I have jTextField1 in jFrame1. When I call jFrame2 from
jFrame1 using "new jFrame2().setVisible(true);" command, I need to
retain the String value of jFrame1.jTextField1 in jFrame 2.
I tried creating a class called 'Global', and a public String variable
'a' within it.
1. I set Global.a = jTextField1.getText() from within jFrame1
2. jFrame2 is able to read and print the value of Global.a properly.
But, when I try this function, it it's getting caught in the if
statement - if (Global.a == "abc") {... }
What are my options for passing jFrame1.jTextField1 value to jFrame2,
so I can display that in the new form.
Thanks in advance!
.
- Follow-Ups:
- Prev by Date: Re: NEED YOUR HELP
- Next by Date: migrate these new US DST settings from JRE1.4.2_11 into JRE 1.4.2_09
- Previous by thread: understand the concept of interfaces
- Next by thread: Re: How do I pass a Text field value from one jFrame1 to jFrame2
- Index(es):