模块 java.desktop

类 JInternalFrame

所有已实现的接口:
ImageObserver , MenuContainer , Serializable , Accessible , RootPaneContainer , WindowConstants

@JavaBean (defaultProperty ="JMenuBar", description ="A frame container which is contained within another window.") public class JInternalFrame extends JComponent implements Accessible , WindowConstants , RootPaneContainer
一个轻量级对象,它提供了原生框架的许多功能,包括拖动、关闭、成为图标、调整大小、标题显示以及对菜单栏的支持。有关面向任务的文档和使用内部框架的示例,请参阅 如何使用内部框架The Java Tutorial 中的一个部分。

通常,您将 JInternalFrame s 添加到 JDesktopPane 。 UI 将特定于外观的操作委托给由 JDesktopPane 维护的 DesktopManager 对象。

JInternalFrame 内容窗格是您添加子组件的地方。为方便起见,覆盖了此类的 addremovesetLayout 方法,以便它们将调用委托给 ContentPane 的相应方法。例如,您可以将子组件添加到内部框架,如下所示:

    internalFrame.add(child);
 
并且孩子将被添加到 contentPane。内容窗格实际上由 JRootPane 的实例管理,该实例还管理内部框架的布局窗格、玻璃窗格和可选菜单栏。有关这些组件的完整说明,请参阅 JRootPane 文档。有关添加、删除和设置 JInternalFrameLayoutManager 的详细信息,请参阅 RootPaneContainer

Warning: Swing 不是线程安全的。有关详细信息,请参阅 Swing 的线程策略

Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder

自从:
1.2
参见:
  • 字段详细信息

    • rootPane

      protected JRootPane  rootPane
      管理此内部框架的内容窗格和可选菜单栏以及玻璃窗格的 JRootPane 实例。
      参见:
    • rootPaneCheckingEnabled

      protected boolean rootPaneCheckingEnabled
      如果为真,则对 addsetLayout 的调用将被转发到 contentPane。这最初是 false,但在构造 JInternalFrame 时设置为 true。
      参见:
    • closable

      protected boolean closable
      框架可以关闭。
    • isClosed

      protected boolean isClosed
      框架已经关闭。
    • maximizable

      protected boolean maximizable
      框架可以扩展到桌面窗格的大小。
    • isMaximum

      protected boolean isMaximum
      框架已扩展到最大尺寸。
      参见:
    • iconable

      protected boolean iconable
      框架可以“图标化”(缩小并显示为图标图像)。
      参见:
    • isIcon

      protected boolean isIcon
      框架已图标化。
      参见:
    • resizable

      protected boolean resizable
      框架的大小可以改变。
    • isSelected

      protected boolean isSelected
      当前选择了框架。
    • frameIcon

      protected Icon  frameIcon
      此内部框架左上角显示的图标。
    • title

      protected String  title
      此内部框架的标题栏中显示的标题。
    • desktopIcon

      protected JInternalFrame.JDesktopIcon  desktopIcon
      图标化此内部框架时显示的图标。子类必须确保在构造期间将其设置为非空值,并且随后不能将其设置为空值。
      参见:
    • CONTENT_PANE_PROPERTY

      public static final String  CONTENT_PANE_PROPERTY
      绑定的属性名称。
      参见:
    • TITLE_PROPERTY

      public static final String  TITLE_PROPERTY
      绑定的属性名称。
      参见:
    • LAYERED_PANE_PROPERTY

      public static final String  LAYERED_PANE_PROPERTY
      绑定的属性名称。
      参见:
    • ROOT_PANE_PROPERTY

      public static final String  ROOT_PANE_PROPERTY
      绑定的属性名称。
      参见:
    • GLASS_PANE_PROPERTY

      public static final String  GLASS_PANE_PROPERTY
      绑定的属性名称。
      参见:
    • FRAME_ICON_PROPERTY

      public static final String  FRAME_ICON_PROPERTY
      绑定的属性名称。
      参见:
    • IS_SELECTED_PROPERTY

      public static final String  IS_SELECTED_PROPERTY
      受约束的属性名称表示该框架处于选中状态。
      参见:
    • IS_CLOSED_PROPERTY

      public static final String  IS_CLOSED_PROPERTY
      指示内部框架已关闭的约束属性名称。
      参见:
    • IS_MAXIMUM_PROPERTY

      public static final String  IS_MAXIMUM_PROPERTY
      表示内部框架最大化的约束属性名称。
      参见:
    • IS_ICON_PROPERTY

      public static final String  IS_ICON_PROPERTY
      指示内部框架已图标化的受限属性名称。
      参见:
  • 构造方法详细信息

    • JInternalFrame

      public JInternalFrame()
      创建一个没有标题的不可调整大小、不可关闭、不可最大化、不可图标化的JInternalFrame
    • JInternalFrame

      public JInternalFrame(String  title)
      创建一个具有指定标题的不可调整大小、不可关闭、不可最大化、不可图标化的JInternalFrame。请注意,传入 null title 会导致未指定的行为并可能导致异常。
      参数:
      title - 在标题栏中显示的非null String
    • JInternalFrame

      public JInternalFrame(String  title, boolean resizable)
      创建具有指定标题和可调整大小的不可关闭、不可最大化、不可图标化的JInternalFrame
      参数:
      title - 要在标题栏中显示的 String
      resizable - 如果是 true ,内部框架可以调整大小
    • JInternalFrame

      public JInternalFrame(String  title, boolean resizable, boolean closable)
      创建具有指定标题、可调整大小和可关闭性的不可最大化、不可图标化的JInternalFrame
      参数:
      title - 要在标题栏中显示的 String
      resizable - 如果是 true ,内部框架可以调整大小
      closable - 如果是 true ,内部框架可以关闭
    • JInternalFrame

      public JInternalFrame(String  title, boolean resizable, boolean closable, boolean maximizable)
      创建具有指定标题、可调整大小、可关闭性和最大化性的非图标化 JInternalFrame
      参数:
      title - 要在标题栏中显示的 String
      resizable - 如果是 true ,内部框架可以调整大小
      closable - 如果是 true ,内部框架可以关闭
      maximizable - 如果是 true ,内部框架可以最大化
    • JInternalFrame

      public JInternalFrame(String  title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
      创建具有指定标题、可调整大小、可关闭性、可最大化性和可图标化性的 JInternalFrame。所有 JInternalFrame 构造函数都使用这个。
      参数:
      title - 要在标题栏中显示的 String
      resizable - 如果是 true ,内部框架可以调整大小
      closable - 如果是 true ,内部框架可以关闭
      maximizable - 如果是 true ,内部框架可以最大化
      iconifiable - 如果是 true ,内部框架可以图标化
  • 方法详情

    • createRootPane

      protected JRootPane  createRootPane()
      由构造函数调用以设置 JRootPane
      返回:
      一个新的JRootPane
      参见:
    • getUI

      public InternalFrameUI  getUI()
      返回呈现此组件的外观对象。
      重写:
      getUI 在类 JComponent
      返回:
      呈现此组件的 InternalFrameUI 对象
    • setUI

      @BeanProperty (hidden =true, visualUpdate =true, description ="The UI object that implements the Component\'s LookAndFeel.") public void setUI(InternalFrameUI  ui)
      为此 JInternalFrame 设置 UI 委托。
      参数:
      ui - UI 委托
    • updateUI

      public void updateUI()
      来自 UIManager 的通知,外观已更改。用 UIManager 的最新版本替换当前 UI 对象。
      重写:
      updateUI 在类 JComponent
      参见:
    • getUIClassID

      @BeanProperty (bound =false, description ="UIClassID") public String  getUIClassID()
      返回呈现此组件的外观类的名称。
      重写:
      getUIClassID 在类 JComponent
      返回:
      字符串“InternalFrameUI”
      参见:
    • isRootPaneCheckingEnabled

      protected boolean isRootPaneCheckingEnabled()
      返回对 addsetLayout 的调用是否转发到 contentPane
      返回:
      如果 addsetLayout 被转发则为真;否则为假
      参见:
    • setRootPaneCheckingEnabled

      @BeanProperty (hidden =true, description ="Whether the add and setLayout methods are forwarded") protected void setRootPaneCheckingEnabled(boolean enabled)
      设置是否将对 addsetLayout 的调用转发到 contentPane
      参数:
      enabled - 如果转发 addsetLayout 则为真,如果它们应直接在 JInternalFrame 上操作则为假。
      参见:
    • addImpl

      protected void addImpl(Component  comp, Object  constraints, int index)
      添加指定的孩子 Component 。此方法被覆盖以有条件地将调用转发给 contentPane 。默认情况下,孩子被添加到 contentPane 而不是框架,有关详细信息,请参阅 RootPaneContainer
      重写:
      addImpl 在类 Container
      参数:
      comp - 要增强的组件
      constraints - 要遵守的约束
      index - 索引
      抛出:
      IllegalArgumentException - 如果 index 无效
      IllegalArgumentException - 如果将容器的父级添加到自身
      IllegalArgumentException - 如果向容器添加窗口
      参见:
    • remove

      public void remove(Component  comp)
      从容器中移除指定的组件。如果 comp 不是 JInternalFrame 的子级,这会将调用转发给 contentPane
      重写:
      remove 在类 Container
      参数:
      comp - 要删除的组件
      抛出:
      NullPointerException - 如果 comp 为空
      参见:
    • setLayout

      public void setLayout(LayoutManager  manager)
      确保默认情况下无法设置此组件的布局。覆盖以有条件地将呼叫转发给 contentPane 。有关详细信息,请参阅 RootPaneContainer
      重写:
      setLayout 在类 Container
      参数:
      manager - LayoutManager
      参见:
    • getMenuBar

      @Deprecated public JMenuBar  getMenuBar()
      已弃用。
      从 Swing 版本 1.0.3 开始,由 getJMenuBar() 取代。
      返回此 JInternalFrame 的当前 JMenuBar,如果未设置菜单栏则返回 null
      返回:
      当前菜单栏,或者 null 如果没有设置
    • getJMenuBar

      public JMenuBar  getJMenuBar()
      返回此 JInternalFrame 的当前 JMenuBar,如果未设置菜单栏则返回 null
      返回:
      这个内部框架使用的JMenuBar
      参见:
    • setMenuBar

      @Deprecated public void setMenuBar(JMenuBar  m)
      已弃用。
      从 Swing 版本 1.0.3 开始,由 setJMenuBar(JMenuBar m) 取代。
      为此 JInternalFrame 设置 menuBar 属性。
      参数:
      m - 在此内部框架中使用的 JMenuBar
      参见:
    • setJMenuBar

      @BeanProperty (preferred =true, description ="The menu bar for accessing pulldown menus from this internal frame.") public void setJMenuBar(JMenuBar  m)
      为此 JInternalFrame 设置 menuBar 属性。
      参数:
      m - 在此内部框架中使用的 JMenuBar
      参见:
    • getContentPane

      public Container  getContentPane()
      返回此内部框架的内容窗格。
      指定者:
      getContentPane 在接口 RootPaneContainer
      返回:
      内容面板
      参见:
    • setContentPane

      @BeanProperty (hidden =true, description ="The client area of the internal frame where child components are normally inserted.") public void setContentPane(Container  c)
      设置此 JInternalFramecontentPane 属性。
      指定者:
      setContentPane 在接口 RootPaneContainer
      参数:
      c - 此内部框架的内容窗格
      抛出:
      IllegalComponentStateException -(运行时异常)如果内容窗格参数为 null
      参见:
    • getLayeredPane

      public JLayeredPane  getLayeredPane()
      返回此内部框架的分层窗格。
      指定者:
      getLayeredPane 在接口 RootPaneContainer
      返回:
      一个 JLayeredPane 对象
      参见:
    • setLayeredPane

      @BeanProperty (hidden =true, description ="The pane which holds the various desktop layers.") public void setLayeredPane(JLayeredPane  layered)
      设置此 JInternalFramelayeredPane 属性。
      指定者:
      setLayeredPane 在接口 RootPaneContainer
      参数:
      layered - 此内部框架的 JLayeredPane
      抛出:
      IllegalComponentStateException -(运行时异常)如果分层窗格参数为 null
      参见:
    • getGlassPane

      public Component  getGlassPane()
      返回此内部框架的玻璃窗格。
      指定者:
      getGlassPane 在接口 RootPaneContainer
      返回:
      玻璃板
      参见:
    • setGlassPane

      @BeanProperty (hidden =true, description ="A transparent pane used for menu rendering.") public void setGlassPane(Component  glass)
      设置此 JInternalFrameglassPane 属性。
      指定者:
      setGlassPane 在接口 RootPaneContainer
      参数:
      glass - 这个内部框架的玻璃面板
      参见:
    • getRootPane

      @BeanProperty (hidden =true, description ="The root pane used by this internal frame.") public JRootPane  getRootPane()
      返回此内部框架的 rootPane 对象。
      指定者:
      getRootPane 在接口 RootPaneContainer
      重写:
      getRootPane 在类 JComponent
      返回:
      rootPane 属性
      参见:
    • setRootPane

      protected void setRootPane(JRootPane  root)
      为此 JInternalFrame 设置 rootPane 属性。该方法由构造函数调用。
      参数:
      root - 新的 JRootPane 对象
    • setClosable

      @BeanProperty (preferred =true, description ="Indicates whether this internal frame can be closed.") public void setClosable(boolean b)
      设置此 JInternalFrame 是否可以通过某些用户操作关闭。
      参数:
      b - boolean,其中 true 表示可以关闭此内部框架
    • isClosable

      public boolean isClosable()
      返回此 JInternalFrame 是否可以通过某些用户操作关闭。
      返回:
      true 如果这个内部框架可以关闭
    • isClosed

      public boolean isClosed()
      返回此 JInternalFrame 当前是否已关闭。
      返回:
      true 如果此内部框架关闭,false 否则
    • setClosed

      @BeanProperty (description ="Indicates whether this internal frame has been closed.") public void setClosed(boolean b) throws PropertyVetoException
      如果参数为 true 则关闭此内部框架。不要使用 false 参数调用此方法;调用 setClosed(false) 的结果未指定。

      如果内部框架已经关闭,则此方法不执行任何操作并立即返回。否则,此方法首先触发 INTERNAL_FRAME_CLOSING 事件。然后此方法将 closed 属性设置为 true 除非监听器否决属性更改。此方法通过使内部框架不可见和未选中,然后触发 INTERNAL_FRAME_CLOSED 事件来完成。

      笔记:要重新使用已关闭的内部框架,您必须将其添加到容器中(即使您从未将其从之前的容器中移除)。通常,此容器将是以前包含内部框架的 JDesktopPane

      参数:
      b - 必须是 true
      抛出:
      PropertyVetoException - 当设置属性的尝试被 JInternalFrame 否决时
      参见:
    • setResizable

      @BeanProperty (preferred =true, description ="Determines whether this internal frame can be resized by the user.") public void setResizable(boolean b)
      设置 JInternalFrame 是否可以通过某些用户操作调整大小。
      参数:
      b - boolean,其中 true 表示可以调整此内部框架的大小
    • isResizable

      public boolean isResizable()
      返回 JInternalFrame 是否可以通过某些用户操作调整大小。
      返回:
      true 如果可以调整此内部框架的大小,false 否则
    • setIconifiable

      @BeanProperty (preferred =true, description ="Determines whether this internal frame can be iconified.") public void setIconifiable(boolean b)
      设置 iconable 属性,该属性必须为 true,用户才能使 JInternalFrame 成为图标。有些外观可能无法实现图标化;他们将忽略此属性。
      参数:
      b - boolean,其中 true 表示可以图标化此内部框架
    • isIconifiable

      public boolean isIconifiable()
      获取 iconable 属性,默认情况下为 false
      返回:
      iconable 属性的值。
      参见:
    • isIcon

      public boolean isIcon()
      返回 JInternalFrame 当前是否图标化。
      返回:
      true 如果这个内部框架被图标化
    • setIcon

      @BeanProperty (description ="The image displayed when this internal frame is minimized.") public void setIcon(boolean b) throws PropertyVetoException
      如果外观支持图标化,则图标化或取消图标化此内部框架。如果内部框架的状态更改为图标化,则此方法会触发 INTERNAL_FRAME_ICONIFIED 事件。如果状态更改为去图标化,则会触发 INTERNAL_FRAME_DEICONIFIED 事件。
      参数:
      b - boolean,其中 true 表示图标化此内部框架,false 表示取消图标化
      抛出:
      PropertyVetoException - 当设置属性的尝试被 JInternalFrame 否决时
      参见:
    • setMaximizable

      @BeanProperty (preferred =true, description ="Determines whether this internal frame can be maximized.") public void setMaximizable(boolean b)
      设置 maximizable 属性,该属性确定 JInternalFrame 是否可以通过某些用户操作最大化。某些外观可能不支持最大化内部框架;他们将忽略此属性。
      参数:
      b - true 指定此内部框架应该是可最大化的; false 指定它不应该
    • isMaximizable

      public boolean isMaximizable()
      获取 maximizable 属性的值。
      返回:
      maximizable 属性的值
      参见:
    • isMaximum

      public boolean isMaximum()
      返回 JInternalFrame 当前是否最大化。
      返回:
      true 如果此内部框架最大化,false 否则
    • setMaximum

      @BeanProperty (description ="Indicates whether this internal frame is maximized.") public void setMaximum(boolean b) throws PropertyVetoException
      最大化并恢复此内部框架。最大化的框架被调整大小以完全适应与 JInternalFrame 关联的 JDesktopPane 区域。恢复帧的大小设置为 JInternalFrame 的实际大小。
      参数:
      b - 一个boolean,其中 true 最大化此内部框架,false 恢复它
      抛出:
      PropertyVetoException - 当设置属性的尝试被 JInternalFrame 否决时
    • getTitle

      public String  getTitle()
      返回 JInternalFrame 的标题。
      返回:
      包含此内部框架标题的 String
      参见:
    • setTitle

      @BeanProperty (preferred =true, description ="The text displayed in the title bar.") public void setTitle(String  title)
      设置 JInternalFrame 标题。 title 可能有一个 null 值。
      参数:
      title - 要在标题栏中显示的 String
      参见:
    • setSelected

      @BeanProperty (description ="Indicates whether this internal frame is currently the active frame.") public void setSelected(boolean selected) throws PropertyVetoException
      选择或取消选择显示的内部框架。如果 JInternalFrame 是选定的框架,它通常会以不同的方式绘制其标题栏,这向用户表明此内部框架具有焦点。当此方法将内部框架的状态从取消选择更改为选择时,它会触发 InternalFrameEvent.INTERNAL_FRAME_ACTIVATED 事件。如果更改是从选中变为取消选中,则会触发 InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED 事件。
      参数:
      selected - boolean,其中 true 表示应选择此内部框架(当前处于活动状态),false 表示应取消选择
      抛出:
      PropertyVetoException - 当设置属性的尝试被 JInternalFrame 否决时
      参见:
    • isSelected

      public boolean isSelected()
      返回 JInternalFrame 是否为当前“选定”或活动框架。
      返回:
      true 如果当前选择了此内部框架(活动)
      参见:
    • setFrameIcon

      @BeanProperty (description ="The icon shown in the top-left corner of this internal frame.") public void setFrameIcon(Icon  icon)
      设置要在此内部框架的标题栏中显示的图像(通常在左上角)。某些外观可能不支持在标题栏中显示图标。此图像不是 desktopIcon 对象,而是当此内部框架图标化时在 JDesktop 中显示的图像。将 null 传递给此函数是有效的,但外观可以为该情况选择适当的行为,例如不显示图标或为外观显示默认图标。
      参数:
      icon - 要在标题栏中显示的 Icon
      参见:
    • getFrameIcon

      public Icon  getFrameIcon()
      返回显示在此内部框架的标题栏中的图像(通常在左上角)。
      返回:
      标题栏中显示的Icon
      参见:
    • moveToFront

      public void moveToFront()
      如果其父级为 JLayeredPane ,则将此组件移动到位置 0 的便捷方法。
    • moveToBack

      public void moveToBack()
      如果其父项是 JLayeredPane ,则将此组件移动到位置 -1 的便捷方法。
    • getLastCursor

      @BeanProperty (bound =false) public Cursor  getLastCursor()
      返回由 setCursor 方法设置的最后一个 Cursor 不是可调整大小的 Cursor
      返回:
      最后一个不可调整大小的Cursor
      自从:
      1.6
    • setCursor

      public void setCursor(Cursor  cursor)
      将光标图像设置为指定的光标。当此组件的 contains 方法针对当前光标位置返回 true 并且此组件可见、可显示且已启用时,将显示此光标图像。设置 Container 的光标会导致该光标显示在容器的所有子组件中,但具有非 null 光标的子组件除外。

      如果 Java 平台实现和/或本机系统不支持更改鼠标光标形状,则该方法可能没有视觉效果。

      重写:
      setCursor 在类 Component
      参数:
      cursor - Cursor 类定义的常量之一;如果这个参数是 null 那么这个组件将继承它的父组件的游标
      自从:
      1.6
      参见:
    • setLayer

      @BeanProperty (bound =false, expert =true, description ="Specifies what desktop layer is used.") public void setLayer(Integer  layer)
      设置该组件层属性的便捷方法。
      参数:
      layer - 指定此框架桌面层的 Integer 对象
      抛出:
      NullPointerException - 如果 layernull
      参见:
    • setLayer

      @BeanProperty (bound =false, expert =true, description ="Specifies what desktop layer is used.") public void setLayer(int layer)
      设置该组件层属性的便捷方法。 setLayer(Integer) 方法应用于 JLayeredPane 中预定义的图层值。使用 setLayer(int) 时,必须注意不要意外地与这些值发生冲突。
      参数:
      layer - 指定此内部框架的桌面层的整数
      自从:
      1.3
      参见:
    • getLayer

      public int getLayer()
      获取该组件层属性的便捷方法。
      返回:
      指定此框架的桌面层的 Integer 对象
      参见:
    • getDesktopPane

      @BeanProperty (bound =false) public JDesktopPane  getDesktopPane()
      在祖先层次结构中搜索 JDesktop 实例的便捷方法。如果 JInternalFrame 找不到,则搜索 desktopIcon 树。
      返回:
      JDesktopPane 这个内部框架属于,或者 null 如果没有找到
    • setDesktopIcon

      @BeanProperty (description ="The icon shown when this internal frame is minimized.") public void setDesktopIcon(JInternalFrame.JDesktopIcon  d)
      设置与此 JInternalFrame 关联的 JDesktopIcon
      参数:
      d - 在桌面上显示的 JDesktopIcon
      抛出:
      NullPointerException - 如果 dnull
      参见:
    • getDesktopIcon

      public JInternalFrame.JDesktopIcon  getDesktopIcon()
      返回图标化此 JInternalFrame 时使用的 JDesktopIcon
      返回:
      桌面上显示的JDesktopIcon
      参见:
    • getNormalBounds

      public Rectangle  getNormalBounds()
      如果 JInternalFrame 未处于最大化状态,则返回 getBounds() ;否则,返回 JInternalFrame 将恢复到的边界。
      返回:
      一个 Rectangle 在正常状态下包含此帧的边界
      自从:
      1.3
    • setNormalBounds

      public void setNormalBounds(Rectangle  r)
      设置此内部框架的正常边界,此内部框架将从其最大化状态恢复到的边界。此方法仅供桌面管理员使用。
      参数:
      r - 此内部框架应恢复到的范围
      自从:
      1.3
    • getFocusOwner

      public Component  getFocusOwner()
      如果此 JInternalFrame 处于活动状态,则返回具有焦点的孩子。否则,返回 null
      返回:
      具有焦点的组件,如果没有子组件具有焦点,则返回 null
      自从:
      1.3
    • getMostRecentFocusOwner

      @BeanProperty (bound =false) public Component  getMostRecentFocusOwner()
      返回此 JInternalFrame 的子组件,当选择此 JInternalFrame 时,它将接收焦点。如果当前选择了这个 JInternalFrame,则此方法返回与 getFocusOwner 方法相同的组件。如果未选择此 JInternalFrame,则将返回最近请求焦点的子组件。如果没有子组件请求过焦点,则返回此 JInternalFrame 的初始可聚焦组件。如果不存在这样的孩子,则返回此 JInternalFrame 的默认焦点组件。
      返回:
      选择此 JInternalFrame 时将获得焦点的子组件
      自从:
      1.4
      参见:
    • restoreSubcomponentFocus

      public void restoreSubcomponentFocus()
      请求内部框架将焦点恢复到具有焦点的最后一个子组件。当用户选择此内部框架时,UI 会使用它——例如,通过单击标题栏。
      自从:
      1.3
    • reshape

      public void reshape(int x, int y, int width, int height)
      移动此组件并调整其大小。与其他组件不同,此实现还强制重新布局,以便始终重新显示标题栏等框架装饰。
      重写:
      reshape 在类 JComponent
      参数:
      x - 一个整数,给出组件从其容器左侧开始测量的新水平位置(以像素为单位)
      y - 一个整数,表示组件的新垂直位置,从其容器底部开始测量,以像素为单位
      width - 一个整数,以像素为单位给出组件的新宽度
      height - 一个整数,以像素为单位给出组件的新高度
      参见:
    • addInternalFrameListener

      public void addInternalFrameListener(InternalFrameListener  l)
      添加指定的监听以从该内部框架接收内部框架事件。
      参数:
      l - 内部框架监听器
    • removeInternalFrameListener

      public void removeInternalFrameListener(InternalFrameListener  l)
      删除指定的内部框架监听,以便它不再接收来自该内部框架的内部框架事件。
      参数:
      l - 内部框架监听器
    • getInternalFrameListeners

      @BeanProperty (bound =false) public InternalFrameListener [] getInternalFrameListeners()
      返回添加到此 JInternalFrameaddInternalFrameListener 的所有 InternalFrameListener 的数组。
      返回:
      添加所有 InternalFrameListener s,如果没有添加任何监听器,则为空数组
      自从:
      1.4
      参见:
    • fireInternalFrameEvent

      protected void fireInternalFrameEvent(int id)
      触发内部框架事件。
      参数:
      id - 被触发的事件类型;以下之一:
      • InternalFrameEvent.INTERNAL_FRAME_OPENED
      • InternalFrameEvent.INTERNAL_FRAME_CLOSING
      • InternalFrameEvent.INTERNAL_FRAME_CLOSED
      • InternalFrameEvent.INTERNAL_FRAME_ICONIFIED
      • InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED
      • InternalFrameEvent.INTERNAL_FRAME_ACTIVATED
      • InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED
      如果事件类型不是上述之一,则什么也不会发生。
    • doDefaultCloseAction

      public void doDefaultCloseAction()
      触发 INTERNAL_FRAME_CLOSING 事件,然后执行由内部框架的默认关闭操作指定的操作。此方法通常由内部框架的关闭按钮的外观实现操作处理程序调用。
      自从:
      1.3
      参见:
    • setDefaultCloseOperation

      public void setDefaultCloseOperation(int operation)
      设置当用户在此内部框架上启动“关闭”时默认发生的操作。可能的选择是:

      DO_NOTHING_ON_CLOSE
      没做什么。这需要程序处理已注册的InternalFrameListener对象的internalFrameClosing方法中的操作。
      HIDE_ON_CLOSE
      自动使内部框架不可见。
      DISPOSE_ON_CLOSE
      自动处理内部框架。

      默认值为 DISPOSE_ON_CLOSE 。在执行指定的关闭操作之前,内部框架会触发一个INTERNAL_FRAME_CLOSING事件。

      参数:
      operation - javax.swing.WindowConstants(由 JInternalFrame 实现的接口)中定义的以下常量之一:DO_NOTHING_ON_CLOSEHIDE_ON_CLOSEDISPOSE_ON_CLOSE
      参见:
    • getDefaultCloseOperation

      public int getDefaultCloseOperation()
      返回当用户在此内部框架上启动“关闭”时发生的默认操作。
      返回:
      用户关闭内部框架时将发生的操作
      参见:
    • pack

      public void pack()
      导致此 JInternalFrame 的子组件按其首选大小进行布局。图标化或最大化的内部框架首先被恢复然后打包。如果内部框架无法恢复,则其状态不会改变,也不会被打包。
      参见:
    • show

      public void show()
      如果内部框架不可见,则将内部框架置于前面,使其可见,并尝试选择它。第一次使内部框架可见时,此方法还会触发 INTERNAL_FRAME_OPENED 事件。如果内部框架已经可见,则此方法不执行任何操作。调用此方法与调用 setVisible(true) 的结果相同。
      重写:
      show 在类 Component
      参见:
    • hide

      public void hide()
      从类复制的描述:JComponent
      重写:
      hide 在类 JComponent
    • dispose

      public void dispose()
      使此内部框架不可见、未选中和关闭。如果框架尚未关闭,此方法将触发 INTERNAL_FRAME_CLOSED 事件。调用此方法的结果类似于 setClosed(true) ,但 dispose 始终成功关闭内部框架并且不会触发 INTERNAL_FRAME_CLOSING 事件。
      参见:
    • toFront

      public void toFront()
      将这个内部框架带到前面。将这个内部框架放在堆叠顺序的顶部,并对其他可见的内部框架进行相应的调整。
      参见:
    • toBack

      public void toBack()
      将这个内部框架发送到后面。将这个内部框架放在堆叠顺序的底部,并对其他可见的内部框架进行相应的调整。
      参见:
    • setFocusCycleRoot

      public final void setFocusCycleRoot(boolean focusCycleRoot)
      什么都不做,因为 JInternalFrame s 必须始终是焦点遍历循环的根。
      重写:
      setFocusCycleRoot 在类 Container
      参数:
      focusCycleRoot - 这个值被忽略
      自从:
      1.4
      参见:
    • isFocusCycleRoot

      public final boolean isFocusCycleRoot()
      总是返回 true 因为所有 JInternalFrame 必须是焦点遍历循环的根。
      重写:
      isFocusCycleRoot 在类 Container
      返回:
      true
      自从:
      1.4
      参见:
    • getFocusCycleRootAncestor

      @BeanProperty (bound =false) public final Container  getFocusCycleRootAncestor()
      始终返回 null 因为 JInternalFrame s 必须始终是焦点遍历循环的根。
      重写:
      getFocusCycleRootAncestor 在类 Component
      返回:
      null
      自从:
      1.4
      参见:
    • getWarningString

      @BeanProperty (bound =false) public final String  getWarningString()
      获取与此内部框架一起显示的警告字符串。由于内部框架始终是安全的(因为它完全包含在可能需要警告字符串的窗口中),此方法始终返回 null
      返回:
      null
      参见:
    • paramString

      protected String  paramString()
      返回此 JInternalFrame 的字符串表示形式。此方法仅用于调试目的,返回字符串的内容和格式可能因实现而异。返回的字符串可能为空,但可能不是 null
      重写:
      paramString 在类 JComponent
      返回:
      这个 JInternalFrame 的字符串表示
    • paintComponent

      protected void paintComponent(Graphics  g)
      重写以允许在拖动内部框架时优化绘画。
      重写:
      paintComponent 在类 JComponent
      参数:
      g - 要保护的 Graphics 对象
      参见:
    • getAccessibleContext

      @BeanProperty (bound =false) public AccessibleContext  getAccessibleContext()
      获取与此 JInternalFrame 关联的 AccessibleContext。对于内部框架,AccessibleContext 采用 AccessibleJInternalFrame 对象的形式。如有必要,将创建一个新的 AccessibleJInternalFrame 实例。
      指定者:
      getAccessibleContext 在接口 Accessible
      重写:
      getAccessibleContext 在类 Component
      返回:
      一个 AccessibleJInternalFrame 作为这个 JInternalFrameAccessibleContext
      参见: