File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes panel and frame (Swing) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "panel and frame (Swing)" Watch "panel and frame (Swing)" New topic

panel and frame (Swing)

Elizabeth Luckose
Ranch Hand

Joined: Aug 17, 2001
Posts: 32
I am using a frame. The frame has a panel in its center. When I click a button in the toolbar in the frame, an internal frame is added to the center of this frame.Suppose after adding this internal frame to the frame, I display another dialog or frame and close this. What happens is that, instead of displaying this internal frame, this panel is shown first and only after sometime the internal frame is displayed.
Plese give a solution
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Elizabeth,
I am not exactly sure what you are doing. But a frame, by default, uses a BorderLayout manager. A BorderLayout only supports a single component in each of its sections. In your discussion you mentioned that you are placing 2 components into the Center (Panel and JInternalFrame). Since you can only have one, maybe you had better remove the Panel when you add the JInternalFrame.
NOTE: JInternalFrame is really designed for JDesktopPane to allow for overlapping components, etc.
I agree. Here's the link:
subject: panel and frame (Swing)
It's not a secret anymore!