public class JInternalFrame extends JComponent implements Accessible, WindowConstants, RootPaneContainer
一般来说,您将JInternalFrame添加到JDesktopPane 。 该UI委托的外观和感觉,具体行动到DesktopManager由维护对象JDesktopPane 。
JInternalFrame内容窗格是您添加子组件的位置。 作为一种方便, add , remove和setLayout这个类的方法将被覆盖,所以他们委托给相应方法的调用ContentPane 。 例如,您可以将子组件添加到内部框架,如下所示:
internalFrame.add(child);
而孩子将被添加到contentPane。
内容窗格实际上由JRootPane实例管理,该实例还管理内部框架的布局窗格,玻璃窗格和可选菜单栏。
有关这些组件的完整说明,请参阅JRootPane文档。
有关添加,删除和设置LayoutManager的LayoutManager的详细信息,请参阅JInternalFrame 。
警告: Swing不是线程安全的。 有关更多信息,请参阅Swing's Threading Policy 。
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,支持所有JavaBeans的长期存储已经添加到java.beans包中。 请参阅XMLEncoder 。
| Modifier and Type | Class and Description |
|---|---|
protected class |
JInternalFrame.AccessibleJInternalFrame
这个类实现了可访问性支持
JInternalFrame类。
|
static class |
JInternalFrame.JDesktopIcon
此组件表示的图标化版本
JInternalFrame 。
|
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closable
框架可以关闭。
|
static String |
CONTENT_PANE_PROPERTY
绑定属性名称。
|
protected JInternalFrame.JDesktopIcon |
desktopIcon
当内部框架被图标化时显示的图标。
|
static String |
FRAME_ICON_PROPERTY
绑定属性名称。
|
protected Icon |
frameIcon
该内部框架左上角显示的图标。
|
static String |
GLASS_PANE_PROPERTY
绑定属性名称。
|
protected boolean |
iconable
框架可以“图标化”(缩小并显示为图标图像)。
|
static String |
IS_CLOSED_PROPERTY
内部框架关闭的约束属性名称。
|
static String |
IS_ICON_PROPERTY
指示内部框架被图标化的约束属性名称。
|
static String |
IS_MAXIMUM_PROPERTY
指示内部框架最大化的约束属性名称。
|
static String |
IS_SELECTED_PROPERTY
受限属性名称表示此框已选择状态。
|
protected boolean |
isClosed
框架已关闭。
|
protected boolean |
isIcon
框架已经被图标化了。
|
protected boolean |
isMaximum
框架已经扩展到最大尺寸。
|
protected boolean |
isSelected
该帧当前被选中。
|
static String |
LAYERED_PANE_PROPERTY
绑定属性名称。
|
protected boolean |
maximizable
该框架可以扩展到桌面窗格的大小。
|
static String |
MENU_BAR_PROPERTY
绑定属性名称。
|
protected boolean |
resizable
框架的尺寸可以更改。
|
static String |
ROOT_PANE_PROPERTY
绑定属性名称。
|
protected JRootPane |
rootPane
管理内容窗格的
JRootPane实例和该内部框架的可选菜单栏以及玻璃窗格。
|
protected boolean |
rootPaneCheckingEnabled
如果是真的,那么
add和
setLayout将被转发到
contentPane 。
|
protected String |
title
标题显示在此内部框架的标题栏中。
|
static String |
TITLE_PROPERTY
绑定属性名称。
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
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标题,可重定位性,可关闭性,最大化和可图标性的JInternalFrame。
|
| Modifier and Type | Method and Description |
|---|---|
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事件,然后执行内部框架的默认关闭操作指定的操作。
|
protected void |
fireInternalFrameEvent(int id)
触发内部框架事件。
|
AccessibleContext |
getAccessibleContext()
获取
AccessibleContext与此相关
JInternalFrame 。
|
Container |
getContentPane()
返回此内部框架的内容窗格。
|
int |
getDefaultCloseOperation()
返回用户在此内部框架上启动“关闭”时发生的默认操作。
|
JInternalFrame.JDesktopIcon |
getDesktopIcon()
返回
JDesktopIcon时,这个曾经
JInternalFrame图标化。
|
JDesktopPane |
getDesktopPane()
在祖先层次结构中搜索
JDesktop实例的
JDesktop方法。
|
Container |
getFocusCycleRootAncestor()
始终返回
null ,因为
JInternalFrame必须始终是焦点遍历循环的根。
|
Component |
getFocusOwner()
如果此
JInternalFrame处于活动状态,则返回具有焦点的小孩。
|
Icon |
getFrameIcon()
返回显示在该内部框架的标题栏中的图像(通常位于左上角)。
|
Component |
getGlassPane()
返回此内部框架的玻璃窗格。
|
InternalFrameListener[] |
getInternalFrameListeners()
返回所有
InternalFrameListener的数组,并添加到
JInternalFrame ,带有
addInternalFrameListener 。
|
JMenuBar |
getJMenuBar()
如果没有设置菜单栏,则返回此
JInternalFrame的当前
JMenuBar ,或
null 。
|
Cursor |
getLastCursor()
返回由
setCursor方法设置的最后
Cursor ,该方法不是可调整
Cursor 。
|
int |
getLayer()
获取此组件的图层属性的便捷方法。
|
JLayeredPane |
getLayeredPane()
返回此内部框架的分层窗格。
|
JMenuBar |
getMenuBar()
已弃用
截至Swing 1.0.3版,由
getJMenuBar() 。
|
Component |
getMostRecentFocusOwner()
返回这个
JInternalFrame的子组件,当选择此
JInternalFrame时将收到焦点。
|
Rectangle |
getNormalBounds()
如果 JInternalFrame没有达到最大化状态,返回getBounds() ;
否则返回JInternalFrame将被还原到的边界。
|
JRootPane |
getRootPane()
返回此内部框架的
rootPane对象。
|
String |
getTitle()
返回
JInternalFrame的标题。
|
InternalFrameUI |
getUI()
返回渲染此组件的外观和对象。
|
String |
getUIClassID()
返回渲染此组件的look-and-feel类的名称。
|
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的
JLayeredPane 。
|
void |
moveToFront()
便利方法将该组件移动到位置0,如果其父级是
JLayeredPane 。
|
void |
pack()
导致此
JInternalFrame按其首选大小排列。
|
protected void |
paintComponent(Graphics g)
被覆盖以允许在拖动内部框架时优化绘画。
|
protected String |
paramString()
返回此
JInternalFrame的字符串表示
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 |
setCursor(Cursor cursor)
将光标图像设置为指定的光标。
|
void |
setDefaultCloseOperation(int operation)
设置用户在此内部框架上启动“关闭”时默认执行的操作。
|
void |
setDesktopIcon(JInternalFrame.JDesktopIcon d)
设置
JDesktopIcon与此相关
JInternalFrame 。
|
void |
setFocusCycleRoot(boolean focusCycleRoot)
不要因为
JInternalFrame必须始终是焦点遍历循环的根源。
|
void |
setFrameIcon(Icon icon)
设置要显示在该内部框架的标题栏中的图像(通常位于左上角)。
|
void |
setGlassPane(Component glass)
设置这个
JInternalFrame的
glassPane属性。
|
void |
setIcon(boolean b)
如果外观和感觉支持图标化,则可以对该内部框架进行图标化或去图标化。
|
void |
setIconifiable(boolean b)
设置
iconable属性,该属性必须为
true才能使用户能够创建
JInternalFrame图标。
|
void |
setJMenuBar(JMenuBar m)
为这个
JInternalFrame设置
menuBar属性。
|
void |
setLayer(int layer)
设置此组件的图层属性的便利方法。
|
void |
setLayer(Integer 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版本1.0.3替换为
setJMenuBar(JMenuBar m) 。
|
void |
setNormalBounds(Rectangle r)
设置此内部框架的正常范围,该内部框架将从其最大化状态恢复到的边界。
|
void |
setResizable(boolean b)
设置是否可以通过某些用户操作调整
JInternalFrame大小。
|
protected void |
setRootPane(JRootPane root)
设置
rootPane属性为
JInternalFrame 。
|
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的外观和感觉已经改变。
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, isPaintingOrigin, 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, updateadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected JRootPane rootPane
JRootPane实例以及此内部框架的可选菜单栏以及玻璃窗格。
JRootPane , RootPaneContainer
protected boolean rootPaneCheckingEnabled
add和setLayout将被转发到contentPane 。
这最初是假的,但是当JInternalFrame时设置为true。
protected boolean closable
protected boolean isClosed
protected boolean maximizable
protected boolean isMaximum
maximizable
protected boolean iconable
protected boolean isIcon
isIcon()
protected boolean resizable
protected boolean isSelected
protected Icon frameIcon
protected String title
protected JInternalFrame.JDesktopIcon desktopIcon
iconable
public static final String CONTENT_PANE_PROPERTY
public static final String MENU_BAR_PROPERTY
public static final String TITLE_PROPERTY
public static final String LAYERED_PANE_PROPERTY
public static final String ROOT_PANE_PROPERTY
public static final String GLASS_PANE_PROPERTY
public static final String FRAME_ICON_PROPERTY
public static final String IS_SELECTED_PROPERTY
public static final String IS_CLOSED_PROPERTY
public static final String IS_MAXIMUM_PROPERTY
public static final String IS_ICON_PROPERTY
public JInternalFrame()
JInternalFrame没有标题。
public JInternalFrame(String title)
JInternalFrame与指定的标题。
请注意,传递null title会导致未指定的行为并可能导致异常。
title - 非
null
String要显示在标题栏
public JInternalFrame(String title, boolean resizable)
JInternalFrame具有指定的标题和可重定向性。
title - 标题栏中显示的
String
resizable - 如果
true ,可以调整内部框架的大小
public JInternalFrame(String title, boolean resizable, boolean closable)
JInternalFrame ,具有指定的标题,可重定位性和可关闭性。
title - 标题栏中显示的
String
resizable - 如果是
true ,可以调整内部框架的大小
closable - 如果是
true ,可以关闭内部框架
public JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable)
JInternalFrame具有指定标题,可调整,可关闭和可最大化。
title - 在标题栏中显示
String
resizable - 如果
true ,可以调整内部框架的大小
closable - 如果是
true ,可以关闭内部框架
maximizable - 如果
true ,内部框架可以最大化
public JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
JInternalFrame具有指定标题,可调整,可关闭,可最大化和图标化。
所有JInternalFrame函数都使用这个。
title - 在标题栏中显示的
String
resizable - 如果是
true ,可以调整内部框架的大小
closable - 如果
true ,内部框架可以关闭
maximizable - 如果
true ,内部框架可以最大化
iconifiable - 如果
true ,内部框架可以图标化
protected JRootPane createRootPane()
JRootPane 。
JRootPane
JRootPane
public InternalFrameUI getUI()
InternalFrameUI对象
public void setUI(InternalFrameUI ui)
JInternalFrame的UI代理。
ui - UI代表
public void updateUI()
UIManager的外观和感觉已经改变。
从UIManager替换最新版本的当前UI对象。
updateUI在
JComponent
JComponent.updateUI()
public String getUIClassID()
getUIClassID在
JComponent
JComponent.getUIClassID() ,
UIDefaults.getUI(javax.swing.JComponent)
protected boolean isRootPaneCheckingEnabled()
add和
setLayout是否转接到
contentPane 。
add和setLayout ,则为true;
否则为假
addImpl(java.awt.Component, java.lang.Object, int) , setLayout(java.awt.LayoutManager) , setRootPaneCheckingEnabled(boolean) , RootPaneContainer
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
protected void addImpl(Component comp, Object constraints, int index)
Component 。
该方法被覆盖以有条件地转移到contentPane 。
默认情况下,将儿童添加到contentPane而不是框架,详情请参考RootPaneContainer 。
addImpl在
Container类
comp - 要加强的组件
constraints - 要遵守的约束
index - 指数
IllegalArgumentException - 如果
index无效
IllegalArgumentException - 如果将容器的父项添加到自身
IllegalArgumentException - 如果向
IllegalArgumentException添加窗口
setRootPaneCheckingEnabled(boolean) , RootPaneContainer
public void remove(Component comp)
comp不是一个孩子JInternalFrame这将调用转发到contentPane 。
remove在
Container
comp - 要删除的组件
NullPointerException - 如果
comp为空
Container.add(java.awt.Component) , RootPaneContainer
public void setLayout(LayoutManager manager)
setLayout在
Container类
manager -
LayoutManager
setRootPaneCheckingEnabled(boolean)
@Deprecated public JMenuBar getMenuBar()
getJMenuBar() 。
JInternalFrame的当前
JMenuBar ,或
null 。
null如果没有设置
public JMenuBar getJMenuBar()
JInternalFrame的当前
JMenuBar ,或
null 。
JMenuBar
setJMenuBar(javax.swing.JMenuBar)
@Deprecated public void setMenuBar(JMenuBar m)
setJMenuBar(JMenuBar m) 。
JInternalFrame设置
menuBar属性。
m - 在这个内部框架中使用的
JMenuBar
getJMenuBar()
public void setJMenuBar(JMenuBar m)
JInternalFrame设置
menuBar属性。
m - 在这个内部框架中使用的
JMenuBar
getJMenuBar()
public Container getContentPane()
getContentPane在界面
RootPaneContainer
RootPaneContainer.setContentPane(java.awt.Container)
public void setContentPane(Container c)
JInternalFrame的
contentPane属性。
setContentPane在界面
RootPaneContainer
c - 此内部框架的内容窗格
IllegalComponentStateException - (运行时异常),如果内容窗格参数是
null
RootPaneContainer.getContentPane()
public JLayeredPane getLayeredPane()
getLayeredPane在接口
RootPaneContainer
JLayeredPane对象
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane) ,
RootPaneContainer.getLayeredPane()
public void setLayeredPane(JLayeredPane layered)
JInternalFrame的
layeredPane属性。
setLayeredPane在接口
RootPaneContainer
layered - 这个内部框架的
JLayeredPane
IllegalComponentStateException - (运行时异常),如果分层窗格参数为
null
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)
public Component getGlassPane()
getGlassPane在界面
RootPaneContainer
RootPaneContainer.setGlassPane(java.awt.Component)
public void setGlassPane(Component glass)
JInternalFrame的
glassPane属性。
setGlassPane在界面
RootPaneContainer
glass - 这个内部框架的玻璃窗格
RootPaneContainer.getGlassPane()
public JRootPane getRootPane()
rootPane对象。
getRootPane在界面
RootPaneContainer
getRootPane在
JComponent类
rootPane属性
RootPaneContainer.getRootPane()
protected void setRootPane(JRootPane root)
rootPane属性用于此JInternalFrame 。
该方法由构造函数调用。
root - 新的
JRootPane对象
public void setClosable(boolean b)
JInternalFrame是否可以被某些用户操作关闭。
b - 一个布尔值,其中
true表示这个内部框架可以关闭
public boolean isClosable()
JInternalFrame 。
true如果这个内部框架可以关闭
public boolean isClosed()
JInternalFrame是否当前关闭。
true如果这个内部框架是关闭的,
false否则
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
public void setResizable(boolean b)
JInternalFrame大小。
b - 一个布尔值,其中
true表示这个内部框架可以调整大小
public boolean isResizable()
JInternalFrame大小。
true如果这个内部框架可以调整大小,
false否则
public void setIconifiable(boolean b)
iconable属性,该属性必须为true ,以便用户能够使JInternalFrame成为图标。
有些看起来和感觉可能不会实现图标化;
他们将忽略此属性。
b - 一个布尔值,其中
true表示这个内部框架可以被图标化
public boolean isIconifiable()
iconable属性,默认为
false 。
iconable属性。
setIconifiable(boolean)
public boolean isIcon()
JInternalFrame是否被图标化。
true如果此内部框架被图标化
public void setIcon(boolean b)
throws PropertyVetoException
INTERNAL_FRAME_ICONIFIED事件。
如果状态更改为去图标化,则会触发一个INTERNAL_FRAME_DEICONIFIED事件。
b - 一个布尔值,其中
true意味着
true这个内部框架,
false意味着去
false
PropertyVetoException - 当设置属性的尝试被否决了
JInternalFrame
InternalFrameEvent.INTERNAL_FRAME_ICONIFIED ,
InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED
public void setMaximizable(boolean b)
maximizable属性,它决定了某些用户操作能否JInternalFrame 。
一些外观和感觉可能不支持最大化内部框架;
他们将忽略此属性。
b - true以指定该内部框架应该是最大化的;
false指定它不应该是
public boolean isMaximizable()
maximizable属性的值。
maximizable属性
setMaximizable(boolean)
public boolean isMaximum()
JInternalFrame是否最大化。
true如果内部框架最大化,
false false
public void setMaximum(boolean b)
throws PropertyVetoException
JDesktopPane与相关联的区域JInternalFrame 。
恢复的帧大小设置为JInternalFrame的实际大小。
b - 一个布尔值,其中
true最大化这个内部框架,
false恢复它
PropertyVetoException - 当试图设置属性被否决的时候
JInternalFrame
public String getTitle()
JInternalFrame的标题。
String包含这个内部框架的标题
setTitle(java.lang.String)
public void setTitle(String title)
JInternalFrame标题。
title可能有一个null值。
title - 标题栏中显示的
String
getTitle()
public void setSelected(boolean selected)
throws PropertyVetoException
JInternalFrame通常绘制其标题栏,其向用户指示该内部帧具有焦点。
当此方法将内部框架的状态从取消选择更改为选定时,将触发InternalFrameEvent.INTERNAL_FRAME_ACTIVATED事件。
如果更改从选定到取消选择,则会触发一个InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED事件。
selected - 一个布尔值,其中
true表示该内部框架应该被选中(当前有效),而
false表示应该被取消选择
PropertyVetoException - 当企图设置财产被否决的时候
JInternalFrame
Component.isShowing() ,
InternalFrameEvent.INTERNAL_FRAME_ACTIVATED ,
InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED
public boolean isSelected()
JInternalFrame是否是当前“选择”或活动帧。
true如果此内部框架当前被选中(有效)
setSelected(boolean)
public void setFrameIcon(Icon icon)
desktopIcon对象,这是在所显示的图像JDesktop当该内部帧被图标化。
将null传递给此功能是有效的,但外观和感觉可以为此情况选择适当的行为,例如不显示图标或外观的默认图标。
icon - 在标题栏中显示
Icon
getFrameIcon()
public Icon getFrameIcon()
Icon显示在标题栏中
setFrameIcon(javax.swing.Icon)
public void moveToFront()
JLayeredPane 。
public void moveToBack()
JLayeredPane则将该组件移动到位置-1的
JLayeredPane 。
public Cursor getLastCursor()
setCursor方法设置的最后
Cursor ,该方法不是可调整
Cursor 。
Cursor
public void setCursor(Cursor cursor)
contains方法为当前光标位置返回true时显示此光标图像,此Component可见,可显示和启用。
设置Container的光标导致该游标显示在所有容器的子组件中,除了具有非null光标的那些。
如果Java平台实现和/或本地系统不支持更改鼠标光标的形状,该方法可能没有视觉效果。
setCursor在
Component
cursor - 由Cursor类定义的Cursor ;
如果此参数为null则此组件将继承其父项的游标
Component.isEnabled() , Component.isShowing() , Component.getCursor() , Component.contains(int, int) , Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String) , Cursor
public void setLayer(Integer layer)
layer - 一个
Integer此框架的桌面图层的
Integer对象
JLayeredPane
public void setLayer(int layer)
setLayer(Integer)应用于JLayeredPane中JLayeredPane层值。
使用setLayer(int)时,必须注意不要意外与这些值冲突。
layer - 指定此内部框架的桌面层的整数
setLayer(Integer) , JLayeredPane
public int getLayer()
Integer此框架的桌面层的
Integer对象
JLayeredPane
public JDesktopPane getDesktopPane()
JDesktop实例的JDesktop方法。
如果JInternalFrame找不到,则搜索desktopIcon树。
JDesktopPane此内部帧属于,或
null如果没有找到
public void setDesktopIcon(JInternalFrame.JDesktopIcon d)
JDesktopIcon与此相关
JInternalFrame 。
d - 在桌面上显示
JDesktopIcon
getDesktopIcon()
public JInternalFrame.JDesktopIcon getDesktopIcon()
JDesktopIcon时,这个曾经
JInternalFrame图标化。
JDesktopIcon显示在桌面上
setDesktopIcon(javax.swing.JInternalFrame.JDesktopIcon)
public Rectangle getNormalBounds()
JInternalFrame未处于最大化状态,则返回getBounds() ;
否则返回JInternalFrame将被还原到的边界。
Rectangle在正常状态下包含此帧的边界
public void setNormalBounds(Rectangle r)
r - 这个内部框架应该恢复到的边界
public Component getFocusOwner()
JInternalFrame处于活动状态,则返回具有焦点的小孩。
否则返回null 。
null如果没有孩子有焦点
public Component getMostRecentFocusOwner()
JInternalFrame的子组件,当选择此JInternalFrame时,该JInternalFrame将接收焦点。
如果此JInternalFrame被选中,该方法返回与getFocusOwner方法相同的getFocusOwner 。
如果未选择此JInternalFrame ,则将返回最近请求焦点的子组件。
如果没有子组件已经请求了焦点,则返回此JInternalFrame的初始可重定向组件。
如果没有这样的孩子存在,那么这个JInternalFrame的默认组件将被返回。
JInternalFrame时将接收焦点的子组件
getFocusOwner() ,
isSelected
public void restoreSubcomponentFocus()
public void reshape(int x,
int y,
int width,
int height)
reshape在
JComponent
x - 一个整数,给出组件的新水平位置,以其容器左侧的像素为单位
y - 一个整数,给出组件的新垂直位置,以其容器底部的像素为单位
width - 给出组件的新宽度(以像素为单位)的整数
height - 给出组件的新高度(以像素为单位)的整数
Component.setBounds(int, int, int, int)
public void addInternalFrameListener(InternalFrameListener l)
l - 内部框架监听器
public void removeInternalFrameListener(InternalFrameListener l)
l - 内部框架监听器
public InternalFrameListener[] getInternalFrameListeners()
InternalFrameListener的数组,并添加到
JInternalFrame与
addInternalFrameListener 。
InternalFrameListener或一个空数组,如果没有添加听众
addInternalFrameListener(javax.swing.event.InternalFrameListener)
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 public void doDefaultCloseAction()
INTERNAL_FRAME_CLOSING事件,然后执行内部框架默认关闭操作指定的操作。
该方法通常由内部框架的关闭按钮的外观实现的动作处理程序调用。
setDefaultCloseOperation(int) ,
InternalFrameEvent.INTERNAL_FRAME_CLOSING
public void setDefaultCloseOperation(int operation)
DO_NOTHING_ON_CLOSE
InternalFrameListener对象的windowClosing方法中InternalFrameListener操作。
HIDE_ON_CLOSE
DISPOSE_ON_CLOSE
默认值为DISPOSE_ON_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
public int getDefaultCloseOperation()
setDefaultCloseOperation(int)
public void pack()
JInternalFrame按其首选大小排列。
图标化或最大化的内部框架首先被还原,然后打包。
如果内部框架无法恢复,则其状态不会更改,也不会被打包。
Window.pack()
public void show()
INTERNAL_FRAME_OPENED事件。
如果内部框架已经可见,则此方法不起作用。
调用此方法与调用setVisible(true)具有相同的结果。
public void hide()
JComponent
hide在
JComponent
public void dispose()
INTERNAL_FRAME_CLOSED事件。
调用此方法的结果类似于setClosed(true) ,但dispose总是成功关闭内部框架,不会触发INTERNAL_FRAME_CLOSING事件。
public void toFront()
Window.toFront() ,
moveToFront()
public void toBack()
Window.toBack() ,
moveToBack()
public final void setFocusCycleRoot(boolean focusCycleRoot)
JInternalFrame必须始终是焦点遍历循环的根。
setFocusCycleRoot在
Container
focusCycleRoot - 忽略此值
isFocusCycleRoot() ,
Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) ,
Container.getFocusTraversalPolicy()
public final boolean isFocusCycleRoot()
true ,因为所有
JInternalFrame都必须是焦点遍历循环的根。
isFocusCycleRoot在
Container
true
setFocusCycleRoot(boolean) ,
Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) ,
Container.getFocusTraversalPolicy()
public final Container getFocusCycleRootAncestor()
null ,因为
JInternalFrame必须始终是焦点遍历循环的根。
getFocusCycleRootAncestor在
Component
null
Container.isFocusCycleRoot()
public final String getWarningString()
null 。
null
Window.getWarningString()
protected String paramString()
JInternalFrame的字符串表示JInternalFrame 。
该方法仅用于调试目的,并且返回的字符串的内容和格式可能因实现而异。
返回的字符串可能为空,但可能不是null 。
paramString在类
JComponent
JInternalFrame的字符串表示
JInternalFrame
protected void paintComponent(Graphics g)
paintComponent在
JComponent
g - 保护的
Graphics对象
JComponent.paint(java.awt.Graphics) , ComponentUI
public AccessibleContext getAccessibleContext()
AccessibleContext与此相关JInternalFrame 。
对于内部框架, AccessibleContext采用AccessibleJInternalFrame对象的形式。
如有必要,将创建一个新的AccessibleJInternalFrame实例。
getAccessibleContext在接口
Accessible
getAccessibleContext在类
Component
AccessibleJInternalFrame作为这个
AccessibleContext的
JInternalFrame
JInternalFrame.AccessibleJInternalFrame
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.