Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


Class UIFrame

public class UIFrame extends UIWindow
{
  // Constructors
  public UIFrame();
  public UIFrame(String name);

  // Methods
  protected boolean forwardEvent(Event e);
  public Frame getFrame();
  public Insets getInsets();
  public UIBandBox getMenuBar();
  public int getStateCode();
  public String getTitle();
  public void layout();
  public void setMenuBar(UIBandBox bar);
  public void setName(String name);
  public void setResizable(boolean resizable);
  public void setTitle(String title);
}

This class implements a frame. A frame is a top-level window with a title and a border. UIFrame extends the UIWindow class.

Note All event and paint notifications sent to the frame are also received by the host (because the host is a child of the frame). The host then routes these notifications to the root container.

A frame is initially hidden when it is first created. You must call the frame's show method to make the frame visible.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIFrame

Constructors

UIFrame

public UIFrame();

Creates a frame with no title.

Remarks:

By default, the frame uses BorderLayout for its layout manager. The host is then added to the center of the frame, and the root container is displayed. Initially, the root container is empty; to add components, call UIRoot.add. By default, the root container uses UIBorderLayout for its layout manager.

Note The frame is initially hidden. You must call the frame's UIWindow.show method to make the frame visible.

For more information about the root container, see the UIFrame overview.

Applications extending UIFrame must call the super method handleEvent() inside the local handleEvent to use tool tips.

See Also: com.ms.ui.UIPanel.setLayout

UIFrame

public UIFrame(String name);

Creates a frame using the specified title.

ParameterDescription
name The title of the frame.

Remarks:

By default, the frame uses BorderLayout for its layout manager. The host is then added to the center of the frame, and the root container is displayed. Initially, the root container is empty; to add components, call UIRoot.add. By default, the root container uses UIBorderLayout for its layout manager.

Note The frame is initially hidden. You must call the frame's UIWindow.show method to make the frame visible.

For more information about the root container, see the UIFrame overview.

See Also: com.ms.ui.UIPanel.setLayout

Methods

forwardEvent

protected boolean forwardEvent(Event e);

Intercepts an event and forwards the event to the parent container.

Return Value:

Returns the event that was intercepted.

getFrame

public Frame getFrame();

Retrieves the underlying AWT frame. Used when the frame is needed by another object, such as a media tracker.

The following code example shows how to set, or change, the icon for a class that extends UIFrame. See FxSystemIcon for additional icons.


//Sets the icon to a stop sign icon.
getFrame().setIconImage(FxSystemIcon.stopIcon.getImage());

Return Value:

Returns the com.ms.awt.Frame object.

getInsets

public Insets getInsets();

Retrieves the insets (margins) of the component.

Return Value:

Returns an inset object containing the margin sizes, in pixels.

getMenuBar

public UIBandBox getMenuBar();

Retrieves the menu bar.

Return Value:

Returns the menu bar if it is an instance of a UIBandBox class; otherwise, returns null.

getStateCode

public int getStateCode();

Retrieves the state of the object.

Return Value:

Returns the combination of the STATE_SYSTEM_MOVABLE and STATE_SYSTEM_SIZEABLE codes, as well as any additional states inherited from the super object.

getTitle

public String getTitle();

Retrieves a string containing the title of the dialog box.

Return Value:

Returns the title of the dialog box.

See Also: setTitle

layout

public void layout();

Sets the layout of the container using the current menu bar and insets.

Return Value:

No return value.

See Also: setMenuBar, getMenuBar, getInsets

setMenuBar

public void setMenuBar(UIBandBox bar);

Sets the current menu bar.

Return Value:

No return value.

ParameterDescription
bar The UIBandBox menu bar to be set as the current menu bar.

setName

public void setName(String name);

Sets the dialog box's name and title.

Return Value:

No return value.

ParameterDescription
name The name (and title) for the container.

See Also: setTitle

setResizable

public void setResizable(boolean resizable);

Sets the resizable flag.

Return Value:

No return value.

ParameterDescription
resizable Set to true if the container is resizable; otherwise, set to false.

setTitle

public void setTitle(String title);

Sets the dialog box's title.

Return Value:

No return value. No return value.

ParameterDescription
title The new title being given to the dialog box.

See Also: getTitle, setName

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.