Linking multpile GUI java?
| |
Currently, I'm building a file in java that requires multiple user interfaces. How do I link them together? Google didn't help. Oh, when I mean link, I mean: GUI1, I store an array full of objects. Now, I switch to GUI2, and am still able to access/modify that array full of objects. Only solution I have is to build all the GUI's in one massive class, and have those variables instantiated in the very beginning before main methods, but I keep getting "can not find symbol class". So I try making GUI2 as a separate class, but I lose all access to variables modified in GUI1. I've hit a road block ;_; |
Re: Linking multpile GUI java?
Link |
by
on 2010-05-14 19:09:43
|
What is the difference between GUI1 and GUI2? |
Re: Linking multpile GUI java?
| |
GUI1 is like a "do everything" interface, while GUI2 is "sign up" interface. How they link: Through sign up, I input data, then it closes when pressing the ok button. Then, with the "do everything" interface, i can modify data entered through the "sign up" interface. |
Re: Linking multpile GUI java?
Link |
by
on 2010-05-14 19:27:02 (edited 2010-05-14 19:28:42)
|
You can use extends to create a hierarchy of interface classes:class gui_admin extends gui_signupgui_admin will call it's super-constructor to set up the basic interface, then add the advanced elements to the GUI explicitly. does that make sense? |
Re: Linking multpile GUI java?
| |
I figured that extends only takes methods from the parent class. Didn't know about taking variables too. Gosh I feel stupid. Thanks for helping me (can close thread now). |