Replication
hi
I have a GUI created in swing.It has a "open" button and when clicked allows to open one file and displays the details of that file .At present i had allowed the user to open only one file.If the user want to open another file the user has to quit and execute the GUI again.I know that it is not a good idea.I want to allow the user to open more than one file and replicate the same stuff for the newly opened files also.How can i do this?
thanks
[468 byte] By [
Gcona] at [2007-10-2 17:51:32]

>If the user want to open another file the user has to quit
> and execute the GUI again.
Why you are doing this..? well am not able to understand you clearly.. very difficult from what have you described.. try to paste some lines of code.. (with formatting tags)..
U can use.. Menus.. and allow open file from there.
You can open as many file as you want.
Thank u for your interest.If i want to paste the code i had to paste the entire GUI code which will be too big.Iam not using any menu.Iam using separate buttons for each task as they do different task and it will not be a good idea to put them in a menu.But i want to know the idea behind opening different files using menus.So that i can use the same idea for opening different files using the button,may be if it is possible.
When you create a menu and open files you replicate the same type of window again with the same features for the newly opened file right?how do you do it?I want to implement the same thing while clicking a button.
It will be greateful if you give me some idea or hint regarding this.
thank you
Gcona at 2007-7-13 19:09:52 >

Thank you for your help and interest..
> U mean something like U do changes in one file..
> and same changes will be reflected in all the open
> files.. ?
I do not want the changes in one file to be reflected in all the open files.But i want to open the same type of GUI (for all the opened files) as i had opened for the first file.
Gcona at 2007-7-13 19:09:52 >

To be more clear when u try to open another file(other than the existing file) in any application like word or say any application for that matter it will open another file in a new window with the same GUI set up as it was for the first file.I mean to say the same type of menus,toolbars,buttons etc is also maintained for the newly opened file.I want to bring the same thing thing in my GUI.How can i do that?
Gcona at 2007-7-13 19:09:52 >

> I do not want the changes in one file to be
> to be reflected in all the open files.But i want to
> open the same type of GUI (for all the opened files)
> as i had opened for the first file.
It's a bit hard to understand what you mean, since your referring to "files" and "GUIs" isn't really intuitive.
However, if I get you right, what about the following:
?Create a (or a group of) UI component(s), I'd say a JPanel, representing the interface for the user to do... whatever it is the users does with his "files". This component would probably best take the File as an argument in its constructor, and only there would it be held.
?Have a entry point, meaning a "MainFrame" with a button, or a menu, whatever, triggering, say, a FileDialog. Having requested the File from the user, create one of the components described above.
?After that the choice is up to you. You could for instance put each of these components in a separate Dialog. You could put them in a TabbedPane. You could create a slice show (meaning viewing only one of the components at once, but being able to switch to the next/previous one). Etc.