Parameters Passing between Two Java Programs
Below code executes when User clicks on menu item Student Dashboard ,two parameters
namely School Name(Sch_name) and School Year (Sch_year) got populated when user enters
School name,School_year in login form.
These two parameters passes into Student Dashboard form and Display on that form.
When user opens(clicks on Student Dashboard) form.
public void actionPerformed(ActionEvent e) {
String Sch_name = school_name.getText();
String School_year = Sch_year.getText();
new Student_DashBoard(Sch_name,School_year).setVisible(true);
Below code is executes when Student Dasboard menu item clicked.
Notice these two parameters(Name of two parameters should remain exactly same)
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run(String Sch_name,String School_year) {
try {
Student_DashBoard frame = new Student_DashBoard(Sch_name,School_year);
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
run the code & modify as per your needs....
Comments
Post a Comment