I have created an application with 3 frames
I want to get the username in frame1 to the frame3 while I want to get useraddress in the frame2 to frame 3.
I did it by making a constructor in frame3 to get above values,
But the question is that it doesn't allow me to create 2 constructors with String type parameters.
Can anyone help me in this case?
I just want to know how two string variables in two forms can be brought to another form,
Please help me...
Pass Variables from form to form
Page 1 of 16 Replies - 844 Views - Last Post: 08 August 2012 - 06:46 AM
Replies To: Pass Variables from form to form
#2
Re: Pass Variables from form to form
Posted 07 August 2012 - 10:33 PM
The code is always very useful when helping problems like this
#3
Re: Pass Variables from form to form
Posted 07 August 2012 - 10:39 PM
If it is because a constructor with two string parameters already exist, then you could either make a constructor with 4 parameters or make an init method which you will call with your arguments
#4
Re: Pass Variables from form to form
Posted 07 August 2012 - 10:59 PM
Thanks Casio...
Benzoate...It is with long code here is what I want to do...
I cannot add the second one. It is obvious for me why it can't be added. But I am asking you is a remedy.
Benzoate...It is with long code here is what I want to do...
.....
Logon(String text) {
getUser=text; //getuser is already defined
initComponents();
Logon(String text1){
getUserAddress=text1;//getUserAddress is already defined
initComponents();
}
}
I cannot add the second one. It is obvious for me why it can't be added. But I am asking you is a remedy.
#5
Re: Pass Variables from form to form
Posted 08 August 2012 - 01:41 AM
You cant have two constructors (methods) with the same definition and parameters list. If you want to pass two parameters then just one constructor that passes two parameter will do the work. So something like:
Hope that will help
Logon(String text, String text1){
getUser=text;
getUserAddress=text1;
Hope that will help
#6
Re: Pass Variables from form to form
Posted 08 August 2012 - 03:28 AM
or
.....
Logon(String text) {
getUser=text; //getuser is already defined
initComponents();
Logon(String text1, int dummyParamNotUsed){
getUserAddress=text1;//getUserAddress is already defined
initComponents();
}
#7
Re: Pass Variables from form to form
Posted 08 August 2012 - 06:46 AM
Thanks pbl and smohd...
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|