• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Window contained in JFrame

 
Raj Verma
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want titles and etc, why don't you just add panels to your Frame?
 
Raj Verma
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks once again Cindy. I think, I can get it now.
 
Terry Stehle
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic