View RSS Feed

Java Swing

Rules of Using Internal Frames

Rate this Entry
by , 04-26-2012 at 09:54 PM (1925 Views)
If any programs have been built by the help of JFrame or other components of the Swing, then already you are having enough knowledge that how internal frames could be used. Rules to use the internal frames have been summarized in the given list:

Internal frame’s size shall be set:
If internal frame’s size is not set, then it will never become visible due to its zero size. Size can be obtained by one of the given methods: setBounds, pack or setSize.

Internal frame’s location shall be set, as per rule:
If location of the internal frame is not set, it will be 0, 0. SetBounds or setLocation methods could be used for specification of the internal frame’s upper left point relative to the container.
To internal frame components can be added by adding them to content pane of the internal frame.

This situation and JFrame situation are similar.

Use JInternalFrame or JOptionPane to implement the internal frames (Dialogs)

Simple dialog can be created by using JOptionPane showInternalXxxDialog methods.

An internal frame shall be added to a container.

If an internal frame is not added to a container then internal frame wouldn’t be visible.

You need to call show or setVisible on internal frames.

By default, internal frames could be seen. Show () or SetVisible (true) shall be invoked to make internal framesvisible.

Internal frame events are fired by the internal frames, not window events.

Internal frame events handling is considered very identical to window events handling.

Submit "Rules of Using Internal Frames" to Facebook Submit "Rules of Using Internal Frames" to Digg Submit "Rules of Using Internal Frames" to Submit "Rules of Using Internal Frames" to StumbleUpon Submit "Rules of Using Internal Frames" to Google