|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--javax.swing.JApplet
JFC/Swing コンポーネントアーキテクチャのサポートを追加する java.applet.Applet の拡張バージョンです。タスクの観点からの JApplet 使用に関するドキュメントは、「The Java Tutorial」の 「How to Make Applets」を参照してください。
JApplet クラスは java.applet.Applet と一部互換性がありません。JApplet は JRootPane をその唯一の子として保持します。JApplet の子はどれでも contentPane を親に持たなければなりません。これは java.applet.Applet とは異なります。たとえば、java.applet.Applet に子を追加するには次のように記述します。
applet.add(child);一方、JApplet を使った場合には、代わりに JApplet の contentPane に子を追加する必要があります。
applet.getContentPane().add(child);LayoutManager の設定、コンポーネントの削除、子のリスト化などでも、同じことが言えます。これらのすべてのメソッドは通常、JApplet 自体ではなく contentPane() に送られます。contentPane() は常に null 以外です。これを null に設定しようとすると、JApplet が例外をスローする原因になります。デフォルトの contentPane() は、BorderLayout マネージャを contentPane に設定させます。
contentPane、glassPane、および layeredPane プロパティの詳細は、JRootPane の説明を参照してください。
標準の Look & Feel (L&F) 表現でこのコンポーネントが使用するキーボードのキーについては、「JApplet のキーの割り当て」を参照してください。
警告:
このクラスの直列化オブジェクトは今後リリースされる Swing との互換性はありません。現在サポートされている直列化は、短期間の保管、または同じバージョンの Swing が稼働しているアプリケーション間の RMI に適しています。1.4 からは、すべての JavaBeansTM の長期間の保管が java.beans パッケージで追加サポートされています。XMLEncoder を参照してください。
| 入れ子クラスの概要 | |
protected class |
JApplet.AccessibleJApplet
このクラスは JApplet クラス用のユーザ補助機能のサポートを実装しています。 |
| クラス java.applet.Applet から継承した入れ子クラス |
|
| クラス java.awt.Panel から継承した入れ子クラス |
|
| クラス java.awt.Container から継承した入れ子クラス |
|
| クラス java.awt.Component から継承した入れ子クラス |
Component.BltBufferStrategy, Component.FlipBufferStrategy |
| フィールドの概要 | |
protected AccessibleContext |
accessibleContext
|
protected JRootPane |
rootPane
|
protected boolean |
rootPaneCheckingEnabled
|
| クラス java.awt.Component から継承したフィールド |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| インタフェース java.awt.image.ImageObserver から継承したフィールド |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| コンストラクタの概要 | |
JApplet()
Swing アプレットのインスタンスを生成します。 |
|
| メソッドの概要 | |
protected void |
addImpl(Component comp,
Object constraints,
int index)
デフォルトでは、子はこのコンポーネントに直接追加できず、代わりに contentPane に追加される必要があります。 |
protected JRootPane |
createRootPane()
コンストラクタメソッドによって呼び出され、デフォルトの rootPane を生成します。 |
AccessibleContext |
getAccessibleContext()
この JApplet に関連した AccessibleContext を取得します。 |
Container |
getContentPane()
アプレットの contentPane オブジェクトを返します。 |
Component |
getGlassPane()
アプレットの glassPane オブジェクトを返します。 |
JMenuBar |
getJMenuBar()
アプレットに設定されたメニューバーを返します。 |
JLayeredPane |
getLayeredPane()
アプレットの layeredPane オブジェクトを返します。 |
JRootPane |
getRootPane()
アプレットの rootPane オブジェクトを返します。 |
protected boolean |
isRootPaneCheckingEnabled()
|
protected String |
paramString()
この JApplet の文字列表現を返します。 |
void |
remove(Component comp)
コンテナから、指定されたコンポーネントを削除します。 |
void |
setContentPane(Container contentPane)
contentPane プロパティを設定します。 |
void |
setGlassPane(Component glassPane)
glassPane プロパティを設定します。 |
void |
setJMenuBar(JMenuBar menuBar)
アプレットのメニューバーを設定します。 |
void |
setLayeredPane(JLayeredPane layeredPane)
layeredPane プロパティを設定します。 |
void |
setLayout(LayoutManager manager)
デフォルトでは、このコンポーネントのレイアウトは設定できません。 |
protected void |
setRootPane(JRootPane root)
rootPane プロパティを設定します。 |
protected void |
setRootPaneCheckingEnabled(boolean enabled)
true の場合、add() および setLayout() を呼び出すと、例外がスローされます。 |
void |
update(Graphics g)
paint(g) の呼び出しだけを行います。 |
| クラス java.applet.Applet から継承したメソッド |
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
| クラス java.awt.Panel から継承したメソッド |
addNotify |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
protected JRootPane rootPane
getRootPane(),
setRootPane(javax.swing.JRootPane)protected boolean rootPaneCheckingEnabled
isRootPaneCheckingEnabled(),
setRootPaneCheckingEnabled(boolean)protected AccessibleContext accessibleContext
| コンストラクタの詳細 |
public JApplet()
throws HeadlessException
このコンストラクタは、コンポーネントのロケールプロパティを JComponent.getDefaultLocale で返される値に設定します。
HeadlessException - GraphicsEnvironment.isHeadless() が true の場合GraphicsEnvironment.isHeadless(),
JComponent.getDefaultLocale()| メソッドの詳細 |
protected JRootPane createRootPane()
public void update(Graphics g)
paint(g) の呼び出しだけを行います。このメソッドは、バックグラウンドクリアを不必要に呼び出さないためにオーバーライドされました。
Container 内の updateg - 指定された Graphics ウィンドウComponent.update(Graphics)public void setJMenuBar(JMenuBar menuBar)
getJMenuBar()public JMenuBar getJMenuBar()
setJMenuBar(javax.swing.JMenuBar)protected boolean isRootPaneCheckingEnabled()
addImpl(java.awt.Component, java.lang.Object, int),
setLayout(java.awt.LayoutManager),
setRootPaneCheckingEnabled(boolean)protected void setRootPaneCheckingEnabled(boolean enabled)
addImpl(java.awt.Component, java.lang.Object, int),
setLayout(java.awt.LayoutManager),
isRootPaneCheckingEnabled()
protected void addImpl(Component comp,
Object constraints,
int index)
thiComponent.getContentPane().add(child)このコンポーネントに直接追加しようとすると、実行時例外がスローされます。サブクラスはこの動作を無効にできます。
Container 内の addImplcomp - 追加されるコンポーネントconstraints - このコンポーネントの配置制約を表現するオブジェクトindex - コンポーネントを挿入するコンテナのリスト内での位置。-1 は最後に挿入することを意味する
Error - rootPaneChecking が true で呼び出された場合setRootPaneCheckingEnabled(boolean)public void remove(Component comp)
Container 内の removecomp - 削除されるコンポーネントContainer.add(java.awt.Component)public void setLayout(LayoutManager manager)
thisComponent.getContentPane().setLayout(new GridLayout(1, 2))このコンポーネントのレイアウトを設定しようとすると、実行時例外がスローされます。サブクラスはこの動作を無効にできます。
Container 内の setLayoutmanager - 指定されたレイアウトマネージャ
Error - rootPaneChecking が true で呼び出された場合setRootPaneCheckingEnabled(boolean)public JRootPane getRootPane()
RootPaneContainer 内の getRootPanesetRootPane(javax.swing.JRootPane),
RootPaneContainer.getRootPane()protected void setRootPane(JRootPane root)
root - このアプレットの rootPane オブジェクトgetRootPane()public Container getContentPane()
RootPaneContainer 内の getContentPanesetContentPane(java.awt.Container),
RootPaneContainer.getContentPane()public void setContentPane(Container contentPane)
RootPaneContainer 内の setContentPanecontentPane - このアプレットの contentPane オブジェクト
IllegalComponentStateException - コンテンツ区画パラメータが null の場合 (実行時例外)getContentPane(),
RootPaneContainer.setContentPane(java.awt.Container)public JLayeredPane getLayeredPane()
RootPaneContainer 内の getLayeredPaneIllegalComponentStateException - 階層化区画パラメータが null の場合 (実行時例外)setLayeredPane(javax.swing.JLayeredPane),
RootPaneContainer.getLayeredPane()public void setLayeredPane(JLayeredPane layeredPane)
RootPaneContainer 内の setLayeredPanelayeredPane - このアプレットの layeredPane オブジェクトgetLayeredPane(),
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)public Component getGlassPane()
RootPaneContainer 内の getGlassPanesetGlassPane(java.awt.Component),
RootPaneContainer.getGlassPane()public void setGlassPane(Component glassPane)
RootPaneContainer 内の setGlassPaneglassPane - このアプレットの glassPane オブジェクトgetGlassPane(),
RootPaneContainer.setGlassPane(java.awt.Component)protected String paramString()
null にはなりません。
Container 内の paramStringpublic AccessibleContext getAccessibleContext()
Accessible 内の getAccessibleContextApplet 内の getAccessibleContext
|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
Java、Java 2D、および JDBC は米国ならびにその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.