For all my previous projects I used JFrames
in which most of the new tasks are opened on new JFrames
on top of a main JFrame
. But for my next project the customer requested new windows to be opened inside the JFrame
( he was referring to JInternalFrame
).
What I want to know is is there any drawbacks wh开发者_开发技巧en using JInternalFrame
? as Sun specifies it's a LightWeight Component
when compared to JFrame
.
as Sun specifies it's a LightWeight Component when compared to JFrame.
A JFrame is basically a lightweight component as well. The border and title is an OS related object and you can't change the behaviour of any of those features. However, all Swing components are added to the content pane of the frame which is a JPanel.
A JInternalFrame also uses a JPanel as a content pane, so, any Swing component that you can add to a JFrame you can add to a JInternalFrame.
Just be sure to add your internal frames to a JDesktopPane
. The tutorial has a list of rules to check. You might look at an open-source project like that uses internal frames, like SQirreL SQL, to see if they needed very many workarounds.
精彩评论