View RSS Feed

JFrame

Java Frame

  1. Internal Frames Performance tip

    by , 04-26-2012 at 08:55 PM
    When various internal frames are present in a desktop, it might be noticed by the user that they move slowly. This problem could be avoided by using outline dragging. With help of outline dragging, just internal frame’s outline is painted at the current position of mouse while internal frame dragging. Innards of internal frames couldn’t be repainted, at new positions, unless dragging is stopped. Default behavior known as live dragging is to repaint or reposition few or all internal frames in a continuous ...
  2. Rules of Using Internal Frames

    by , 04-26-2012 at 08:54 PM
    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 ...
    Categories
    JFrame
  3. Internal Frames vs. Regular Frames

    by , 04-26-2012 at 08:53 PM
    Code that is used for internal frames and regular swing frames is very similar, in variety of ways. Root panes are present in internal frames which are used to setup GUIs, for JInternalFrame that is quite same as the GUI setup, for JFrame. Other APIs are also provided by the JInternalFrames which makes it just like JFrame.

    Internal frames are not top level or windows container, but this makes them to differ from frames. Let us say for example, an internal frame shall be added to a ...
  4. How to Use Internal Frames

    by , 04-26-2012 at 08:52 PM
    A JFrame could be displayed by the JInternalFrame. Usually internal frames are added to the the desktop. Desktop pan might be used for the JFrame’s content pane. Desktop is JDesktopPane’s instance that is basically the JLayeredPane subclass which made API addition for management of various overlapped internal frames.

    Carefully it shall be considered that either GUI of your program could be based around internal frames or frames. To make a switch from internal frames towards frames, ...
    Categories
    JFrame
  5. Responding to Window-Closing Events

    by , 04-26-2012 at 08:51 PM
    When a frame onscreen is closed by a user, frame gets hidden by defauly. Though it is visible, still the frame is present and it might be made visible by the program once again. If different behavior is needed on your partm then either get registered the window listener which controls the window closings or default close behavior could be specified by the help of method setDefaultCloseOperation. Both of them could also be done.

    Given values shall be there for setDefaultCloseOperation ...
    Categories
    JFrame
  6. Creating and Showing Frames

    by , 04-26-2012 at 08:50 PM
    Extremely plain window’s picture is given below that is made by the demonstration application FrameDemo. Source code could be found in FrameDemo.java. FrameDemo could be run (downloading JDK6, or later.)

    How to setup a frame has been shown in the given code of FrameDemo.

    Java Code:
    //1. Create the frame.
    JFrame frame = new JFrame("FrameDemo");
    
    //2. Optional: What happens when the frame closes?
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    ...
    Categories
    JFrame
  7. How to Make Frames (Main Windows)

    by , 04-26-2012 at 08:50 PM
    Frame is considered to be a top leveled window that has a border and a title. Frame size consist of any area which has been designated for sake of border. Border area dimensions might be obtained by method getInsets. Border area is also present in frame’s overall size so frame’s portion is obscured effectively, which constraint the area present to render or display the subcomponents, to that rectangle which consists of location of upper left corner (insets.left, insets.top), and width size (insets.left ...
    Tags: main windows Add / Edit Tags
    Categories
    JFrame