Thursday, March 3, 2016

Java : Building Better GUI (GUI for framework ),without looping

Building Better GUI (GUI for framework)


Use following steps as guideline :
  1. Use Eclipse .
  2. Add window builder plugin to eclipse 
  3. While Creating Swing file , Select "Dialog" in Swing Designer 
  4. Create a GUI as required
  5. Right click on components to add listeners .
  6. 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