java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JInternalFrame
- 所有已实现的接口:
- ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
public class JInternalFrame
- extends JComponent
- implements Accessible, WindowConstants, RootPaneContainer
- extends JComponent
提供很多本机窗体功能的轻量级对象,这些功能包括拖动、关闭、变成图标、调整大小、标题显示和支持菜单栏。有关使用内部窗体的面向任务的文档和示例,请参见《The Java Tutorial》中的 How to Use Internal Frames 一节。
通常,可将 JInternalFrame
添加到 JDesktopPane
中。UI 将特定于外观的操作委托给由 JDesktopPane
维护的 DesktopManager
对象。
JInternalFrame
内容窗格是添加子组件的地方。作为 add
的便捷方法及其变体,已经重写了 remove
和 setLayout
,以在必要时将其转发到 contentPane
。这意味着可以编写:
internalFrame.add(child);子级将被添加到 contentPane。内容窗格实际上由
JRootPane
的实例管理,它还管理 layoutPane、glassPane 和内部窗体的可选菜单栏。有关这些组件的完整描述,请参见 JRootPane
文档。有关添加、移除和设置 JInternalFrame
的 LayoutManager
的详情,请参阅 RootPaneContainer
。警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans
包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder
。
- 另请参见:
InternalFrameEvent
,JDesktopPane
,DesktopManager
,JInternalFrame.JDesktopIcon
,JRootPane
,RootPaneContainer
嵌套类摘要 | |
---|---|
protected class | JInternalFrame.AccessibleJInternalFrame 此类实现对 JInternalFrame 类的可访问性支持。 |
static class | JInternalFrame.JDesktopIcon 此组件表示 JInternalFrame 的图标化版本。 |
从类 javax.swing.JComponent 继承的嵌套类/接口 |
---|
JComponent.AccessibleJComponent |
从类 java.awt.Container 继承的嵌套类/接口 |
---|
Container.AccessibleAWTContainer |
从类 java.awt.Component 继承的嵌套类/接口 |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
字段摘要 | |
---|---|
protected boolean | closable 可以关闭的窗体。 |
static String | CONTENT_PANE_PROPERTY Bound 属性名。 |
protected JInternalFrame.JDesktopIcon | desktopIcon 此内部窗体图标化时所显示的图标。 |
static String | FRAME_ICON_PROPERTY Bound 属性名。 |
protected Icon | frameIcon 此内部窗体左上角显示的图标。 |
static String | GLASS_PANE_PROPERTY Bound 属性名。 |
protected boolean | iconable 可以“图标化”frame(缩小并显示为图标图像)。 |
static String | IS_CLOSED_PROPERTY Constrained 属性名,指示该内部窗体已关闭。 |
static String | IS_ICON_PROPERTY Constrained 属性名,指示该内部窗体已图标化。 |
static String | IS_MAXIMUM_PROPERTY Constrained 属性名,指示该内部窗体已最大化。 |
static String | IS_SELECTED_PROPERTY Constrained 属性名,指示此窗体具有选定状态。 |
protected boolean | isClosed 已经关闭的窗体。 |
protected boolean | isIcon frame 已图标化。 |
protected boolean | isMaximum 已将窗体扩展到其最大大小。 |
protected boolean | isSelected 当前已选中窗体。 |
static String | LAYERED_PANE_PROPERTY Bound 属性名。 |
protected boolean | maximizable 可将窗体扩展到桌面窗格的大小。 |
static String | MENU_BAR_PROPERTY Bound 属性名。 |
protected boolean | resizable 可以更改窗体的大小。 |
static String | ROOT_PANE_PROPERTY Bound 属性名。 |
protected JRootPane | rootPane JRootPane 实例管理此内部窗体的 contentPane 和可选的 menuBar,以及 glassPane。 |
protected boolean | rootPaneCheckingEnabled 如果为 true,则将对 add 和 setLayout 的调用转发到 contentPane 。 |
protected String | title 此内部窗体标题栏中所显示的标题。 |
static String | TITLE_PROPERTY Bound 属性名。 |
从类 javax.swing.JComponent 继承的字段 |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
从类 java.awt.Component 继承的字段 |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
从接口 javax.swing.WindowConstants 继承的字段 |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
从接口 java.awt.image.ImageObserver 继承的字段 |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
构造方法摘要 | |
---|---|
JInternalFrame() 创建不可调整大小的、不可关闭的、不可最大化的、不可图标化的、没有标题的 JInternalFrame 。 | |
JInternalFrame(String title) 创建不可调整大小的、不可关闭的、不可最大化的、不可图标化的、具有指定标题的 JInternalFrame 。 | |
JInternalFrame(String title, boolean resizable) 创建不可关闭的、不可最大化的、不可图标化的,以及具有指定标题和可调整大小的 JInternalFrame 。 | |
JInternalFrame(String title, boolean resizable, boolean closable) 创建不可最大化的、不可图标化的,以及具有指定标题、可调整大小和可关闭的 JInternalFrame 。 | |
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable) 创建不可图标化的,但具有指定标题、可调整大小、可关闭和可最大化的 JInternalFrame 。 | |
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable) 创建具有指定标题、可调整、可关闭、可最大化和可图标化的 JInternalFrame 。 |
方法摘要 | |
---|---|
protected void | addImpl(Component comp, Object constraints, int index) 添加指定的子 Component 。 |
void | addInternalFrameListener(InternalFrameListener l) 添加指定的侦听器,以从此内部窗体接收内部窗体事件。 |
protected JRootPane | createRootPane() 构造方法调用此方法来设置 JRootPane 。 |
void | dispose() 使此内部窗体不可见、取消选定并关闭它。 |
void | doDefaultCloseAction() 激发 INTERNAL_FRAME_CLOSING 事件,然后执行内部窗体的默认 close 操作所指定的操作。 |
protected void | fireInternalFrameEvent(int id) 激发内部窗体事件。 |
AccessibleContext | getAccessibleContext() 获得与此 JInternalFrame 关联的 AccessibleContext 。 |
Container | getContentPane() 返回此内部窗体的内容窗格。 |
int | getDefaultCloseOperation() 返回用户在此内部窗体上发起 "close" 时默认执行的操作。 |
JInternalFrame.JDesktopIcon | getDesktopIcon() 返回图标化此 JInternalFrame 时使用的 JDesktopIcon 。 |
JDesktopPane | getDesktopPane() 在祖先层次结构中搜索 JDesktop 实例的便捷方法。 |
Container | getFocusCycleRootAncestor() 始终返回 null ,原因是 JInternalFrame 必须始终为焦点遍历循环的根。 |
Component | getFocusOwner() 如果此 JInternalFrame 处于激活状态,则返回具有焦点的子组件。 |
Icon | getFrameIcon() 返回要在此内部窗体的标题栏中显示的图像(通常显示在左上角)。 |
Component | getGlassPane() 返回此内部窗体的 glassPane。 |
InternalFrameListener[] | getInternalFrameListeners() 返回使用 addInternalFrameListener 添加到此 JInternalFrame 的所有 InternalFrameListener 的数组。 |
JMenuBar | getJMenuBar() 返回此 JInternalFrame 的当前 JMenuBar ;如果尚未设置菜单栏,则返回 null 。 |
int | getLayer() 获得此组件 layer 属性的便捷方法。 |
JLayeredPane | getLayeredPane() 返回此内部窗体的 layeredPane。 |
JMenuBar | getMenuBar() 已过时。 从 Swing version 1.0.3 开始,由 getJMenuBar() 取代。 |
Component | getMostRecentFocusOwner() 返回选定此 JInternalFrame 时,将接收焦点的 JInternalFrame 子组件。 |
Rectangle | getNormalBounds() 如果 JInternalFrame 未处于最大化状态,则返回 getBounds() ;否则返回还原 JInternalFrame 后的边界。 |
JRootPane | getRootPane() 返回此内部窗体的 rootPane 对象。 |
String | getTitle() 返回 JInternalFrame 的标题。 |
InternalFrameUI | getUI() 返回呈现此组件的外观对象。 |
String | getUIClassID() 返回呈现此组件的外观类名。 |
String | getWarningString() 获取此内部窗体中显示的警告字符串。 |
void | hide() |
boolean | isClosable() 返回是否可以通过某个用户操作关闭此 JInternalFrame 。 |
boolean | isClosed() 返回此 JInternalFrame 当前是否已关闭。 |
boolean | isFocusCycleRoot() 始终返回 true ,原因是所有 JInternalFrame 必须为焦点遍历循环的根。 |
boolean | isIcon() 返回 JInternalFrame 当前是否已图标化。 |
boolean | isIconifiable() 获取该 iconable 属性(默认情况下为 false )。 |
boolean | isMaximizable() 获取该 maximizable 属性的值。 |
boolean | isMaximum() 返回 JInternalFrame 当前是否已最大化。 |
boolean | isResizable() 返回是否可以通过某个用户操作调整 JInternalFrame 的大小。 |
protected boolean | isRootPaneCheckingEnabled() 返回是否将对 add 和 setLayout 的调用转发到 contentPane 。 |
boolean | isSelected() 返回 JInternalFrame 当前是否为“选定的”或处于激活状态的窗体。 |
void | moveToBack() 如果此组件的父组件是 JLayeredPane ,则将此组件移至位置 -1 的便捷方法。 |
void | moveToFront() 如果此组件的父组件是 JLayeredPane ,则将此组件移至位置 0 的便捷方法。 |
void | pack() 使此 JInternalFrame 的子组件按其首选大小进行布局。 |
protected void | paintComponent(Graphics g) 重写此方法,以便在拖动内部窗体时允许进行优化的绘制。 |
protected String | paramString() 返回此 JInternalFrame 的字符串表示形式。 |
void | remove(Component comp) 从此容器中移除指定组件。 |
void | removeInternalFrameListener(InternalFrameListener l) 移除指定的内部窗体侦听器,不再接收此内部窗体发出的内部窗体事件。 |
void | reshape(int x, int y, int width, int height) 移动此组件并调整其大小。 |
void | restoreSubcomponentFocus() 请求内部窗体将焦点还原到具有焦点的最后一个子组件。 |
void | setClosable(boolean b) 设置是否可以通过某个用户操作关闭此 JInternalFrame 。 |
void | setClosed(boolean b) 如果参数为 true ,则关闭此内部窗体。 |
void | setContentPane(Container c) 设置此 JInternalFrame 的 contentPane 属性。 |
void | setDefaultCloseOperation(int operation) 设置用户在此内部窗体上发起 "close" 时默认执行的操作。 |
void | setDesktopIcon(JInternalFrame.JDesktopIcon d) 设置与此 JInternalFrame 关联的 JDesktopIcon 。 |
void | setFocusCycleRoot(boolean focusCycleRoot) 不执行任何操作,原因是 JInternalFrame 必须始终为焦点遍历循环的根。 |
void | setFrameIcon(Icon icon) 设置要在此内部窗体的标题栏中显示的图像(通常显示在左上角)。 |
void | setGlassPane(Component glass) 设置此 JInternalFrame 的 glassPane 属性。 |
void | setIcon(boolean b) 如果外观支持图标化,则对此内部窗体执行图标化或取消图标化。 |
void | setIconifiable(boolean b) 设置 iconable 属性,对于能够使 JInternalFrame 变成一个图标的用户而言,该属性必须为 true 。 |
void | setJMenuBar(JMenuBar m) 设置此 JInternalFrame 的 menuBar 属性。 |
void | setLayer(int layer) 设置此组件 layer 属性的便捷方法。 |
void | setLayer(Integer layer) 设置此组件 layer 属性的便捷方法。 |
void | setLayeredPane(JLayeredPane layered) 设置此 JInternalFrame 的 layeredPane 属性。 |
void | setLayout(LayoutManager manager) 确保默认情况下无法设置此组件的布局。 |
void | setMaximizable(boolean b) 设置 maximizable 属性,该属性确定是否可以通过某个用户操作最大化此 JInternalFrame 。 |
void | setMaximum(boolean b) 最大化并还原此内部窗体。 |
void | setMenuBar(JMenuBar m) 已过时。 从 Swing version 1.0.3 开始,由 setJMenuBar(JMenuBar m) 取代。 |
void | setNormalBounds(Rectangle r) 设置此内部窗体的正常边界,即此内部窗体从其最大化状态还原后的边界。 |
void | setResizable(boolean b) 设置是否可以通过某个用户操作调整 JInternalFrame 的大小。 |
protected void | setRootPane(JRootPane root) 设置此 JInternalFrame 的 rootPane 属性。 |
protected void | setRootPaneCheckingEnabled(boolean enabled) 设置是否将对 add 和 setLayout 的调用转发到 contentPane 。 |
void | setSelected(boolean selected) 如果要显示内部窗体,则选定或取消选定该窗体。 |
void | setTitle(String title) 设置 JInternalFrame 的标题。 |
void | setUI(InternalFrameUI ui) 设置此 JInternalFrame 的 UI 委托。 |
void | show() 如果内部窗体不可见,则将该内部窗体置于前端,使其可见并尝试选定它。 |
void | toBack() 将此内部窗体发送至后台。 |
void | toFront() 将此内部窗体置于前端。 |
void | updateUI() 来自 UIManager 的通知,告知外观已更改。 |
从类 javax.swing.JComponent 继承的方法 |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
从类 java.awt.Container 继承的方法 |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
从类 java.awt.Component 继承的方法 |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
字段详细信息 |
---|
rootPane
protected JRootPane rootPane
JRootPane
实例管理此内部窗体的 contentPane 和可选的 menuBar,以及 glassPane。- 另请参见:
JRootPane
,RootPaneContainer
rootPaneCheckingEnabled
protected boolean rootPaneCheckingEnabled
- 如果为 true,则将对
add
和setLayout
的调用转发到contentPane
。初始设置为 false,但在构造JInternalFrame
时将其设置为 true。- 另请参见:
isRootPaneCheckingEnabled()
,setRootPaneCheckingEnabled(boolean)
,RootPaneContainer
closable
protected boolean closable
- 可以关闭的窗体。
isClosed
protected boolean isClosed
- 已经关闭的窗体。
maximizable
protected boolean maximizable
- 可将窗体扩展到桌面窗格的大小。
isMaximum
protected boolean isMaximum
- 已将窗体扩展到其最大大小。
- 另请参见:
maximizable
iconable
protected boolean iconable
- 可以“图标化”frame(缩小并显示为图标图像)。
- 另请参见:
JInternalFrame.JDesktopIcon
,setIconifiable(boolean)
isIcon
protected boolean isIcon
- frame 已图标化。
- 另请参见:
isIcon()
resizable
protected boolean resizable
- 可以更改窗体的大小。
isSelected
protected boolean isSelected
- 当前已选中窗体。
frameIcon
protected Icon frameIcon
- 此内部窗体左上角显示的图标。
title
protected String title
- 此内部窗体标题栏中所显示的标题。
desktopIcon
protected JInternalFrame.JDesktopIcon desktopIcon
- 此内部窗体图标化时所显示的图标。
- 另请参见:
iconable
CONTENT_PANE_PROPERTY
public static final String CONTENT_PANE_PROPERTY
- Bound 属性名。
- 另请参见:
- 常量字段值
MENU_BAR_PROPERTY
public static final String MENU_BAR_PROPERTY
- Bound 属性名。
- 另请参见:
- 常量字段值
TITLE_PROPERTY
public static final String TITLE_PROPERTY
- Bound 属性名。
- 另请参见:
- 常量字段值
LAYERED_PANE_PROPERTY
public static final String LAYERED_PANE_PROPERTY
- Bound 属性名。
- 另请参见:
- 常量字段值
ROOT_PANE_PROPERTY
public static final String ROOT_PANE_PROPERTY
- Bound 属性名。
- 另请参见:
- 常量字段值
GLASS_PANE_PROPERTY
public static final String GLASS_PANE_PROPERTY
- Bound 属性名。
- 另请参见:
- 常量字段值
FRAME_ICON_PROPERTY
public static final String FRAME_ICON_PROPERTY
- Bound 属性名。
- 另请参见:
- 常量字段值
IS_SELECTED_PROPERTY
public static final String IS_SELECTED_PROPERTY
- Constrained 属性名,指示此窗体具有选定状态。
- 另请参见:
- 常量字段值
IS_CLOSED_PROPERTY
public static final String IS_CLOSED_PROPERTY
- Constrained 属性名,指示该内部窗体已关闭。
- 另请参见:
- 常量字段值
IS_MAXIMUM_PROPERTY
public static final String IS_MAXIMUM_PROPERTY
- Constrained 属性名,指示该内部窗体已最大化。
- 另请参见:
- 常量字段值
IS_ICON_PROPERTY
public static final String IS_ICON_PROPERTY
- Constrained 属性名,指示该内部窗体已图标化。
- 另请参见:
- 常量字段值
构造方法详细信息 |
---|
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
- 另请参见:
JRootPane
getUI
public InternalFrameUI getUI()
- 返回呈现此组件的外观对象。
- 返回:
- 呈现此组件的
InternalFrameUI
对象
setUI
public void setUI(InternalFrameUI ui)
- 设置此
JInternalFrame
的 UI 委托。- 参数:
ui
- UI 委托
updateUI
public void updateUI()
- 来自
UIManager
的通知,告知外观已更改。用UIManager
的最新版本替换当前的 UI 对象。- 覆盖:
- 类
JComponent
中的updateUI
- 另请参见:
JComponent.updateUI()
getUIClassID
public String getUIClassID()
- 返回呈现此组件的外观类名。
- 覆盖:
- 类
JComponent
中的getUIClassID
- 返回:
- "InternalFrameUI" 字符串
- 另请参见:
JComponent.getUIClassID()
,UIDefaults.getUI(javax.swing.JComponent)
isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
- 返回是否将对
add
和setLayout
的调用转发到contentPane
。- 返回:
- 如果转发
add
和setLayout
,则返回 true;否则返回 false - 另请参见:
addImpl(java.awt.Component, java.lang.Object, int)
,setLayout(java.awt.LayoutManager)
,setRootPaneCheckingEnabled(boolean)
,RootPaneContainer
setRootPaneCheckingEnabled
protected void setRootPaneCheckingEnabled(boolean enabled)
- 设置是否将对
add
和setLayout
的调用转发到contentPane
。- 参数:
enabled
- 如果转发add
和setLayout
,则为 true;如果应直接在JInternalFrame
上操作,则为 false。- 另请参见:
addImpl(java.awt.Component, java.lang.Object, int)
,setLayout(java.awt.LayoutManager)
,isRootPaneCheckingEnabled()
,RootPaneContainer
addImpl
protected void addImpl(Component comp, Object constraints, int index)
- 添加指定的子
Component
。重写此方法,从而有条件地将调用转发到contentPane
。默认情况下将子组件添加到contentPane
而不是窗体中,有关详情,请参阅RootPaneContainer
。- 覆盖:
- 类
Container
中的addImpl
- 参数:
comp
- 子组件所添加到的组件constraints
- 要遵守的约束条件index
- 索引- 抛出:
IllegalArgumentException
- 如果index
无效IllegalArgumentException
- 如果将容器的父级添加到其本身IllegalArgumentException
- 如果向容器内添加窗口- 另请参见:
setRootPaneCheckingEnabled(boolean)
,RootPaneContainer
remove
public void remove(Component comp)
- 从此容器中移除指定组件。如果
comp
不是JInternalFrame
的子级,则将调用转发到contentPane
。- 覆盖:
- 类
Container
中的remove
- 参数:
comp
- 要移除的组件- 抛出:
NullPointerException
- 如果comp
为 null- 另请参见:
Container.add(java.awt.Component)
,RootPaneContainer
setLayout
public void setLayout(LayoutManager manager)
- 确保默认情况下无法设置此组件的布局。重写此方法,从而有条件地将调用转发到
contentPane
。有关更多信息,请参阅RootPaneContainer
。- 覆盖:
- 类
Container
中的setLayout
- 参数:
manager
-LayoutManager
- 另请参见:
setRootPaneCheckingEnabled(boolean)
getMenuBar
@Deprecatedpublic JMenuBar getMenuBar()
- 已过时。 从 Swing version 1.0.3 开始,由
getJMenuBar()
取代。- 返回此
JInternalFrame
的当前JMenuBar
;如果尚未设置菜单栏,则返回null
。- 返回:
- 当前的菜单栏;如果尚未设置菜单栏,则返回
null
- 返回此
getJMenuBar
public JMenuBar getJMenuBar()
- 返回此
JInternalFrame
的当前JMenuBar
;如果尚未设置菜单栏,则返回null
。- 返回:
- 此内部窗体使用的
JMenuBar
- 另请参见:
setJMenuBar(javax.swing.JMenuBar)
setMenuBar
@Deprecatedpublic void setMenuBar(JMenuBar m)
- 已过时。 从 Swing version 1.0.3 开始,由
setJMenuBar(JMenuBar m)
取代。- 设置此
JInternalFrame
的menuBar
属性。- 参数:
m
- 此内部窗体中使用的JMenuBar
- 另请参见:
getJMenuBar()
- 设置此
setJMenuBar
public void setJMenuBar(JMenuBar m)
- 设置此
JInternalFrame
的menuBar
属性。- 参数:
m
- 此内部窗体中使用的JMenuBar
- 另请参见:
getJMenuBar()
getContentPane
public Container getContentPane()
- 返回此内部窗体的内容窗格。
- 指定者:
- 接口
RootPaneContainer
中的getContentPane
- 返回:
- 内容窗格
- 另请参见:
RootPaneContainer.setContentPane(java.awt.Container)
setContentPane
public void setContentPane(Container c)
- 设置此
JInternalFrame
的contentPane
属性。- 指定者:
- 接口
RootPaneContainer
中的setContentPane
- 参数:
c
- 此内部窗体的内容窗格- 抛出:
IllegalComponentStateException
- (运行时异常)如果 contentPane 参数为null
- 另请参见:
RootPaneContainer.getContentPane()
getLayeredPane
public JLayeredPane getLayeredPane()
- 返回此内部窗体的 layeredPane。
- 指定者:
- 接口
RootPaneContainer
中的getLayeredPane
- 返回:
JLayeredPane
对象- 另请参见:
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)
,RootPaneContainer.getLayeredPane()
setLayeredPane
public void setLayeredPane(JLayeredPane layered)
- 设置此
JInternalFrame
的layeredPane
属性。- 指定者:
- 接口
RootPaneContainer
中的setLayeredPane
- 参数:
layered
- 此内部窗体的JLayeredPane
- 抛出:
IllegalComponentStateException
- (运行时异常)如果 layeredPane 参数为null
- 另请参见:
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)
getGlassPane
public Component getGlassPane()
- 返回此内部窗体的 glassPane。
- 指定者:
- 接口
RootPaneContainer
中的getGlassPane
- 返回:
- glassPane
- 另请参见:
RootPaneContainer.setGlassPane(java.awt.Component)
setGlassPane
public void setGlassPane(Component glass)
- 设置此
JInternalFrame
的glassPane
属性。- 指定者:
- 接口
RootPaneContainer
中的setGlassPane
- 参数:
glass
- 此内部窗体的 glassPane- 另请参见:
RootPaneContainer.getGlassPane()
getRootPane
public JRootPane getRootPane()
- 返回此内部窗体的
rootPane
对象。- 指定者:
- 接口
RootPaneContainer
中的getRootPane
- 覆盖:
- 类
JComponent
中的getRootPane
- 返回:
rootPane
属性- 另请参见:
RootPaneContainer.getRootPane()
setRootPane
protected void setRootPane(JRootPane root)
- 设置此
JInternalFrame
的rootPane
属性。此方法由构造方法调用。- 参数:
root
- 新的JRootPane
对象
setClosable
public void setClosable(boolean b)
- 设置是否可以通过某个用户操作关闭此
JInternalFrame
。- 参数:
b
- boolean 值,其中true
意味着可以关闭此内部窗体
isClosable
public boolean isClosable()
- 返回是否可以通过某个用户操作关闭此
JInternalFrame
。- 返回:
- 如果可以关闭此内部窗体,则返回
true
isClosed
public boolean isClosed()
- 返回此
JInternalFrame
当前是否已关闭。- 返回:
- 如果此内部窗体已关闭,则返回
true
;否则返回false
setClosed
public void setClosed(boolean b) throws PropertyVetoException
- 如果参数为
true
,则关闭此内部窗体。不要调用带有false
参数的此方法;调用setClosed(false)
的结果是不明确的。如果已关闭内部窗体,则此方法不执行任何操作并立即返回。否则此方法通过激发
INTERNAL_FRAME_CLOSING
事件来开始执行。然后此方法将closed
属性设置为true
,除非侦听器禁止属性更改。最后此方法通过使内部窗体不可见和不可选择,然后激发INTERNAL_FRAME_CLOSED
事件来结束操作。注:要想重用已关闭的内部窗体,您必须将其添加到容器中(即使从未将其从以前的容器中移除也是如此)。通常,此容器是以前包含该内部窗体的
JDesktopPane
。- 参数:
b
- 必须为true
- 抛出:
PropertyVetoException
- 如果JInternalFrame
禁止设置该属性- 另请参见:
isClosed()
,setDefaultCloseOperation(int)
,dispose()
,InternalFrameEvent.INTERNAL_FRAME_CLOSING
setResizable
public void setResizable(boolean b)
- 设置是否可以通过某个用户操作调整
JInternalFrame
的大小。- 参数:
b
- boolean 值,其中true
意味着可以调整此内部窗体的大小
isResizable
public boolean isResizable()
- 返回是否可以通过某个用户操作调整
JInternalFrame
的大小。- 返回:
- 如果可以调整此内部窗体的大小,则返回
true
;否则返回false
setIconifiable
public void setIconifiable(boolean b)
- 设置
iconable
属性,对于能够使JInternalFrame
变成一个图标的用户而言,该属性必须为true
。某些外观可能不实现图标化;它们将忽略此属性。- 参数:
b
- boolean 值,其中true
意味着可以图标化此内部窗体
isIconifiable
public boolean isIconifiable()
- 获取该
iconable
属性(默认情况下为false
)。- 返回:
iconable
属性的值。- 另请参见:
setIconifiable(boolean)
isIcon
public boolean isIcon()
- 返回
JInternalFrame
当前是否已图标化。- 返回:
- 如果此内部窗体已图标化,则返回
true
setIcon
public void setIcon(boolean b) throws PropertyVetoException
- 如果外观支持图标化,则对此内部窗体执行图标化或取消图标化。如果内部窗体的状态更改为图标化,则此方法激发
INTERNAL_FRAME_ICONIFIED
事件。如果该状态更改为取消图标化,则激发INTERNAL_FRAME_DEICONIFIED
事件。- 参数:
b
- boolean 值,其中true
意味着图标化此内部窗体,而false
意味着取消其图标化- 抛出:
PropertyVetoException
- 如果JInternalFrame
禁止设置该属性- 另请参见:
InternalFrameEvent.INTERNAL_FRAME_ICONIFIED
,InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED
setMaximizable
public void setMaximizable(boolean b)
- 设置
maximizable
属性,该属性确定是否可以通过某个用户操作最大化此JInternalFrame
。某些外观可能不支持最大化内部窗体;它们会忽略此属性。- 参数:
b
-true
指示此窗体应该是可最大化的;false
指示其不应该是可最大化的
isMaximizable
public boolean isMaximizable()
- 获取该
maximizable
属性的值。- 返回:
maximizable
属性的值- 另请参见:
setMaximizable(boolean)
isMaximum
public boolean isMaximum()
- 返回
JInternalFrame
当前是否已最大化。- 返回:
- 如果此内部窗体已最大化,则返回
true
;否则返回false
setMaximum
public void setMaximum(boolean b) throws PropertyVetoException
- 最大化并还原此内部窗体。将已最大化的窗体的大小调整为完全适合与
JInternalFrame
关联的JDesktopPane
区域。将已还原的窗体的大小设置为JInternalFrame
的实际大小。- 参数:
b
- boolean 值,其中true
意味着最大化此内部窗体;false
意味着还原它- 抛出:
PropertyVetoException
-JInternalFrame
如果禁止设置该属性
getTitle
public String getTitle()
- 返回
JInternalFrame
的标题。- 返回:
- 包含此内部窗体标题的
String
- 另请参见:
setTitle(java.lang.String)
setTitle
public void setTitle(String title)
- 设置
JInternalFrame
的标题。title
可能为null
值。- 参数:
title
- 标题栏中要显示的String
- 另请参见:
getTitle()
setSelected
public void setSelected(boolean selected) throws PropertyVetoException
- 如果要显示内部窗体,则选定或取消选定该窗体。如果内部窗体是已选定的窗体,则
JInternalFrame
以不同的方式绘制其标题栏,向用户指示此内部窗体具有焦点。当此方法将内部窗体的状态从取消选定更改为选定时,它会激发InternalFrameEvent.INTERNAL_FRAME_ACTIVATED
事件。如果将状态从选定更改为取消选定,则激发InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED
事件。- 参数:
selected
- boolean 值,其中true
意味着此内部窗体应该成为选定的窗体(当前处于激活状态);false
意味着此内部窗体应该成为取消选定的窗体- 抛出:
PropertyVetoException
-JInternalFrame
如果设置该属性- 另请参见:
Component.isShowing()
,InternalFrameEvent.INTERNAL_FRAME_ACTIVATED
,InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED
isSelected
public boolean isSelected()
- 返回
JInternalFrame
当前是否为“选定的”或处于激活状态的窗体。- 返回:
- 如果此内部窗体当前为选定的(处于激活状态),则返回
true
- 另请参见:
setSelected(boolean)
setFrameIcon
public void setFrameIcon(Icon icon)
- 设置要在此内部窗体的标题栏中显示的图像(通常显示在左上角)。此图像不是
desktopIcon
对象,desktopIcon 对象是图标化此内部窗体时在JDesktop
中所显示的图像。向此函数传入null
是有效的,但在此情况下外观可选择适当的行为,如不显示图标,或者显示该外观的默认图标。- 参数:
icon
- 标题栏中要显示的Icon
- 另请参见:
getFrameIcon()
getFrameIcon
public Icon getFrameIcon()
- 返回要在此内部窗体的标题栏中显示的图像(通常显示在左上角)。
- 返回:
- 标题栏中显示的
Icon
- 另请参见:
setFrameIcon(javax.swing.Icon)
moveToFront
public void moveToFront()
- 如果此组件的父组件是
JLayeredPane
,则将此组件移至位置 0 的便捷方法。
moveToBack
public void moveToBack()
- 如果此组件的父组件是
JLayeredPane
,则将此组件移至位置 -1 的便捷方法。
setLayer
public void setLayer(Integer layer)
- 设置此组件 layer 属性的便捷方法。
- 参数:
layer
- 指定此窗体的桌面层的Integer
对象- 另请参见:
JLayeredPane
setLayer
public void setLayer(int layer)
- 设置此组件 layer 属性的便捷方法。对于
JLayeredPane
中预定义的 layer 值,应该使用setLayer(Integer)
方法。使用setLayer(int)
时,必须注意不要意外地与这些值冲突。- 参数:
layer
- 指定此内部窗体的桌面层的整数- 从以下版本开始:
- 1.3
- 另请参见:
setLayer(Integer)
,JLayeredPane
getLayer
public int getLayer()
- 获得此组件 layer 属性的便捷方法。
- 返回:
- 指定此窗体的桌面层的
Integer
对象 - 另请参见:
JLayeredPane
getDesktopPane
public JDesktopPane getDesktopPane()
- 在祖先层次结构中搜索
JDesktop
实例的便捷方法。如果JInternalFrame
未找到 JDesktop 实例,则搜索desktopIcon
树。- 返回:
- 此内部窗体所属于的
JDesktopPane
;如果找不到,则为null
setDesktopIcon
public void setDesktopIcon(JInternalFrame.JDesktopIcon d)
- 设置与此
JInternalFrame
关联的JDesktopIcon
。- 参数:
d
- 要在桌面上显示的JDesktopIcon
- 另请参见:
getDesktopIcon()
getDesktopIcon
public JInternalFrame.JDesktopIcon getDesktopIcon()
- 返回图标化此
JInternalFrame
时使用的JDesktopIcon
。- 返回:
- 在桌面上显示的
JDesktopIcon
- 另请参见:
setDesktopIcon(javax.swing.JInternalFrame.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
public Component getMostRecentFocusOwner()
- 返回选定此
JInternalFrame
时,将接收焦点的JInternalFrame
子组件。如果当前已选定此JInternalFrame
,则此方法返回与getFocusOwner
方法相同的组件。如果尚未选定此JInternalFrame
,则返回最近请求焦点的子组件。如果没有子组件请求过焦点,则返回此JInternalFrame
的初始 focusable 组件。如果不存在这种子组件,则返回此JInternalFrame
接收焦点的默认组件。- 返回:
- 选定此
JInternalFrame
时将接收焦点的子组件 - 从以下版本开始:
- 1.4
- 另请参见:
getFocusOwner()
,isSelected
restoreSubcomponentFocus
public void restoreSubcomponentFocus()
- 请求内部窗体将焦点还原到具有焦点的最后一个子组件。用户选定此内部窗体时(例如通过单击标题栏)由 UI 使用此方法。
- 从以下版本开始:
- 1.3
reshape
public void reshape(int x, int y, int width, int height)
- 移动此组件并调整其大小。与其他组件不同,此实现还会强制进行重新布局,因此总是重新显示窗体装饰,例如标题栏。
- 覆盖:
- 类
JComponent
中的reshape
- 参数:
x
- 给出该组件新水平位置的整数,该位置从其容器的左边开始,以像素为单位y
- 给出该组件新垂直位置的整数,该位置从其容器的底边开始,以像素为单位width
- 给出该组件新宽度的整数,以像素为单位height
- 给出该组件新高度的整数,以像素为单位- 另请参见:
Component.setBounds(int, int, int, int)
addInternalFrameListener
public void addInternalFrameListener(InternalFrameListener l)
- 添加指定的侦听器,以从此内部窗体接收内部窗体事件。
- 参数:
l
- 内部窗体侦听器
removeInternalFrameListener
public void removeInternalFrameListener(InternalFrameListener l)
- 移除指定的内部窗体侦听器,不再接收此内部窗体发出的内部窗体事件。
- 参数:
l
- 内部窗体侦听器
getInternalFrameListeners
public InternalFrameListener[] getInternalFrameListeners()
- 返回使用
addInternalFrameListener
添加到此JInternalFrame
的所有InternalFrameListener
的数组。- 返回:
- 已添加的所有
InternalFrameListener
,如果尚未添加侦听器,则返回一个空数组 - 从以下版本开始:
- 1.4
- 另请参见:
addInternalFrameListener(javax.swing.event.InternalFrameListener)
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
事件,然后执行内部窗体的默认 close 操作所指定的操作。此方法通常由外观实现的操作处理程序为该内部窗体的 close 按钮所调用。- 从以下版本开始:
- 1.3
- 另请参见:
setDefaultCloseOperation(int)
,InternalFrameEvent.INTERNAL_FRAME_CLOSING
setDefaultCloseOperation
public void setDefaultCloseOperation(int operation)
- 设置用户在此内部窗体上发起 "close" 时默认执行的操作。可能的选项为:
DO_NOTHING_ON_CLOSE
- 不执行任何操作。这要求程序在已注册
InternalFrameListener
对象的windowClosing
方法中处理该操作。 HIDE_ON_CLOSE
- 自动使该内部窗体不可见。
DISPOSE_ON_CLOSE
- 自动释放该内部窗体。
默认值是 DISPOSE_ON_CLOSE
。执行指定的 close 操作前,该内部窗体激发 INTERNAL_FRAME_CLOSING
事件。
- 参数:
operation
- 在javax.swing.WindowConstants
(由JInternalFrame
所实现的接口)中定义的以下常量之一:DO_NOTHING_ON_CLOSE
、HIDE_ON_CLOSE
或DISPOSE_ON_CLOSE
- 另请参见:
addInternalFrameListener(javax.swing.event.InternalFrameListener)
,getDefaultCloseOperation()
,JComponent.setVisible(boolean)
,dispose()
,InternalFrameEvent.INTERNAL_FRAME_CLOSING
getDefaultCloseOperation
public int getDefaultCloseOperation()
- 返回用户在此内部窗体上发起 "close" 时默认执行的操作。
- 返回:
- 用户关闭内部窗体时所执行的操作
- 另请参见:
setDefaultCloseOperation(int)
pack
public void pack()
- 使此
JInternalFrame
的子组件按其首选大小进行布局。首先还原然后打包已图标化或最大化的内部窗体。如果无法还原内部窗体,则不更改其状态并且不对其进行打包。- 另请参见:
Window.pack()
show
public void show()
- 如果内部窗体不可见,则将该内部窗体置于前端,使其可见并尝试选定它。首次使该内部窗体可见时,此方法还激发
INTERNAL_FRAME_OPENED
事件。如果内部窗体已经可见,则此方法不执行任何操作。调用此方法与调用setVisible(true)
具有相同的效果。- 覆盖:
- 类
Component
中的show
- 另请参见:
moveToFront()
,setSelected(boolean)
,InternalFrameEvent.INTERNAL_FRAME_OPENED
,JComponent.setVisible(boolean)
hide
public void hide()
- 覆盖:
- 类
Component
中的hide
dispose
public void dispose()
- 使此内部窗体不可见、取消选定并关闭它。如果还未关闭该窗体,则此方法激发
INTERNAL_FRAME_CLOSED
事件。调用此方法的结果与调用setClosed(true)
类似,但是dispose
总是成功地关闭内部窗体,并且不激发INTERNAL_FRAME_CLOSING
事件。- 另请参见:
InternalFrameEvent.INTERNAL_FRAME_CLOSED
,JComponent.setVisible(boolean)
,setSelected(boolean)
,setClosed(boolean)
toFront
public void toFront()
- 将此内部窗体置于前端。将此内部窗体置于堆栈顺序的顶部,并且对其他可见的内部窗体进行相应的调整。
- 另请参见:
Window.toFront()
,moveToFront()
toBack
public void toBack()
- 将此内部窗体发送至后台。将此内部窗体置于堆栈顺序的底部,并且对其他可见的内部窗体进行相应的调整。
- 另请参见:
Window.toBack()
,moveToBack()
setFocusCycleRoot
public final void setFocusCycleRoot(boolean focusCycleRoot)
- 不执行任何操作,原因是
JInternalFrame
必须始终为焦点遍历循环的根。- 覆盖:
- 类
Container
中的setFocusCycleRoot
- 参数:
focusCycleRoot
- 忽略此值- 从以下版本开始:
- 1.4
- 另请参见:
isFocusCycleRoot()
,Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
,Container.getFocusTraversalPolicy()
isFocusCycleRoot
public final boolean isFocusCycleRoot()
- 始终返回
true
,原因是所有JInternalFrame
必须为焦点遍历循环的根。- 覆盖:
- 类
Container
中的isFocusCycleRoot
- 返回:
true
- 从以下版本开始:
- 1.4
- 另请参见:
setFocusCycleRoot(boolean)
,Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
,Container.getFocusTraversalPolicy()
getFocusCycleRootAncestor
public final Container getFocusCycleRootAncestor()
- 始终返回
null
,原因是JInternalFrame
必须始终为焦点遍历循环的根。- 覆盖:
- 类
Component
中的getFocusCycleRootAncestor
- 返回:
null
- 从以下版本开始:
- 1.4
- 另请参见:
Container.isFocusCycleRoot()
getWarningString
public final String getWarningString()
- 获取此内部窗体中显示的警告字符串。因为内部窗体始终是安全的(由于它完全包含在窗口中,而该窗口可能需要警告字符串),所以此方法始终返回
null
。- 返回:
null
- 另请参见:
Window.getWarningString()
paramString
protected String paramString()
- 返回此
JInternalFrame
的字符串表示形式。此方法仅在进行调试的时候使用,对于各个实现,所返回字符串的内容和格式可能有所不同。返回的字符串可能为空,但不可能为null
。- 覆盖:
- 类
JComponent
中的paramString
- 返回:
- 此
JInternalFrame
的字符串表示形式
paintComponent
protected void paintComponent(Graphics g)
- 重写此方法,以便在拖动内部窗体时允许进行优化的绘制。
- 覆盖:
- 类
JComponent
中的paintComponent
- 参数:
g
- 要保护的Graphics
对象- 另请参见:
JComponent.paint(java.awt.Graphics)
,ComponentUI
getAccessibleContext
public AccessibleContext getAccessibleContext()
- 获得与此
JInternalFrame
关联的AccessibleContext
。对于内部窗体,AccessibleContext
采用AccessibleJInternalFrame
对象的形式。如果有必要,创建一个新的AccessibleJInternalFrame
实例。- 指定者:
- 接口
Accessible
中的getAccessibleContext
- 覆盖:
- 类
JComponent
中的getAccessibleContext
- 返回:
AccessibleJInternalFrame
,它用作此JInternalFrame
的AccessibleContext
- 另请参见:
JInternalFrame.AccessibleJInternalFrame