Building Better GUI (GUI for framework)
Use following steps as guideline :
- Use Eclipse .
- Add window builder plugin to eclipse
- While Creating Swing file , Select "Dialog" in Swing Designer
- Create a GUI as required
- Right click on components to add listeners .
- In the Main class (calling function) , use below Code :
CODE :
public class test3 {
public static boolean bGUI_Yes=false;
public static void main(String[] args) {
GUI2 f2=new GUI2();// GUI2 is the GUI created using window builder
f2.setModal(true); //Modal tells thread to wait until user enters data ,should always be visible
f2.setVisible(true);
if(test3.bGUI_Yes==true) // set to true in the action listener inside OK button
System.out.println(f2.bGUI_UseExcel+ " "+f2.sGUI_testcases+" "+f2.sBrowser);
else
System.out.println("closed");
}
}
Note :
Cant stress enough - Select Dialog never select Jframe for this case .
No comments:
Post a Comment