How can i pass the data from one JPanel to other...?
I have a jframe which contains 3 jpanel. I want to pass the Jtextfield value of one panel to other. Each panel is shown using JTabbedPane. I am getting null when i access the value of other text field.
pacage Demotool;
Class:MainFrame
This is the actionPerformed code of first panel
both str and scrTxt is (public static)
public void actionPerformed(ActionEvent e)
{
String act=e.getActionCommand();
if(act.equals("ADD"))
{
str=scrnTxt.getText();
System.out.println("Hi :"+str);
Demotool.DemoTool.jtp.setSelectedIndex(1);
}
}
pacage Demotool;
class name:DetailForm
I imported the class
import Demotool.MainFrame.*;
using the belove code i tried to access the data:
System.out.println("Hello:"+Demotool.MainFrame.str );
but i am getting null string;