Originally posted by Eric Crockett:
That looks about right, as long as I can add JTextFields, JLists, JButtons etc to a panel (or just the Dialog itself) then that IS exactly what I want!
A JDialog behaves exactly the same as a JFrame as far as setting layouts and adding components.
Prior to
Java 1.5, you had to get a frame/dialog's content pane using getContentPane(). This Container could then be used to set the layout and add components just as regular containers like JPanel.
In Java 1.5 and up, you can set the layout of the frame/dialog directly, as well as add components. This will basically use the content pane in the background.
So if you already have a panel, you can call dialog.getContentPane().add(panel), or even dialog.setContentPane(panel).
I have been messing around with JInternalFrame, any comment on why one would be better than the other?
JInternalFrame is mostly used inside a JDesktopPane for an MDI environment; the JInternalFrame will not exit the JDesktopPane area. JDialog however can be used anywhere, will be shown on top of its parent frame (or dialog), and can be moved all over the screen.