|
-
May 18th, 2007, 01:11 AM
#1
Thread Starter
Member
coding standard
Hi ,
I have given below the logic for my requirement. I already coded it and works fine . But I want to know is this common practice or this is very ugly coding . Please give suggestion on this. I also apologize for my english knowledge.
I will provide the actual code if needed.
I have created two class one is Main which is having main() and another class for GUI
In the Main Class i declared three instance variable
uname, upwd and isfinish
one method to start process StartProcess()
one methos to show GUI ShowGui()
I called StartProcess() within main() by creating instance of own.
in StartProcess i called ShowGUI()
( reason for this is StartProcess() contains coding for many process and calling GUI is one of those. )
In SHowGUI() I instanciated GUIclass by passing it object "this"
Code:
public void ShowGUI(){
GUIClass ch = new GUIClass( this )
ch.setVisible( true )
/* IN THE GUICLASS i have populated uname and upwd variable of "this"
At this point i want to println the values of uname and upwd so i wait untill the GUICLASS return the control back to this so GUIclass also populates isFinish with true and for that i did */
while( !isFinish ){
}
System.out.println( uname + upwd ) // this works
}
If i dont include while loop uname and upwd remain null as this was executed immediately after calling the GUIClass.
Hope that you understood what i want to say.
Please suggest that is this ok, I m new to java programming
thanks
Last edited by newmember; May 18th, 2007 at 01:14 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|