File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Window contained in JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Window contained in JFrame" Watch "Window contained in JFrame" New topic
Author

Window contained in JFrame

Raj Verma
Greenhorn

Joined: Apr 17, 2001
Posts: 5
I am trying to create an application and my main frame for the application is JFrame. I want all the other windows to be contained in this JFrame, but they should not have the title bar, as in VB or PB where they are called child window. Is there anyway I can do it. I have tried using JInternalFrame.
Thanks


/.\ /.\<BR> ----<BR> `..'
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If you don't want titles and etc, why don't you just add panels to your Frame?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Raj Verma
Greenhorn

Joined: Apr 17, 2001
Posts: 5
Thanks for your response Cindy, but Can I open multiple panels in JFrame window ??
My main JFrame has menu, and on Menu I have menu items like : Customer, Account, Transaction. What I want to do is open Customer window, but it should be contained in the main JFrame, and then if I want to, I can open Account or Transaction window also.
Hope it wasnt confusing.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Yes you can have multiple panels in a frame, you just need to get an appropriate LayoutManager to manipulate them. For instance if the Frame has a GridLayout -
f.setLayout(new GridLayout(3,1)); // has 3 areas stacked on top of each other
you can put a different panel in each grid, and give each panel whatever LayoutManger you want.
However for what you describe, you would need to manipulate the GridLayout dependant on how many of the menu items were open at once. Also you don't get the window mainipulating things like minimize and x to close with panels. The program has to deal with them.
Have you looked at JTabbedPane as an option. Instead of having a menu open different functions in a window, the tabs just switch the user to the function desired. Of course only one shows up at a time.
Raj Verma
Greenhorn

Joined: Apr 17, 2001
Posts: 5
Thanks once again Cindy. I think, I can get it now.
Terry Stehle
Greenhorn

Joined: Mar 24, 2001
Posts: 24
Originally posted by Raj Verma:
I am trying to create an application and my main frame for the application is JFrame. I want all the other windows to be contained in this JFrame, but they should not have the title bar, as in VB or PB where they are called child window. Is there anyway I can do it. I have tried using JInternalFrame.
Thanks

Maybe what you are looking for is JDesktopPane, anyways thought I would input
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Window contained in JFrame