|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Dialog
ダイアログはタイトルとボーダを持つトップレベルのウィンドウであり、ユーザが何らかの入力を行うために通常使用されます。ダイアログのサイズには、ボーダのために指定された領域が含まれます。ボーダ領域の寸法は getInsets
メソッドを使うことにより取得できます。ただし、ボーダ領域の寸法はプラットフォームに依存するので、pack
または show
のどちらかを呼び出してダイアログを表示可能にしないと正確なインセット値は取得できません。ボーダ領域はダイアログ全体のサイズに含まれているため、ダイアログの一部が隠れてしまうことがあります。このため、サブコンポーネントを描画および表示するための領域は、左上隅の位置が (insets.left, insets.top)
であり、幅 width - (insets.left + insets.right)
、高さ height - (insets.top + insets.bottom)
の矩形に制限されます。
ダイアログのデフォルトのレイアウトは BorderLayout
です。
ダイアログはネイティブな装飾 (Frame
と Titlebar
) を持つことができ、setUndecorated
でこれを無効化できます。フレームが displayable
の状態でない時にだけ無効化できます。
ダイアログを作成するときには、フレームまたはもう 1 つのダイアログをその所有者として定義しなければなりません。表示されているダイアログの所有者ウィンドウが非表示になった場合や最小化された場合、そのダイアログは自動的にユーザに対して表示されなくなります。オーナウィンドウがまた開かれると、ダイアログは再びユーザに対して表示されます。
マルチスクリーン環境では、Dialog
を所有者とは別の画面デバイス上に生成することができます。詳細は Frame
を参照してください。
ダイアログは、モードなし (デフォルト) またはモーダルのどちらかになります。モーダルダイアログの場合、そのダイアログを所有者として生成されたウィンドウを除き、アプリケーションのほかのトップレベルウィンドウへの入力はできなくなります。
ダイアログは、WindowOpened
、WindowClosing
、WindowClosed
、WindowActivated
、WindowDeactivated
、WindowGainedFocus
、および WindowLostFocus
の WindowEvents
を生成できます。
WindowEvent
,
Window.addWindowListener(java.awt.event.WindowListener)
,
直列化された形式入れ子クラスの概要 | |
protected class |
Dialog.AccessibleAWTDialog
このクラスは Dialog クラス用のユーザ補助機能のサポートを実装しています。 |
クラス java.awt.Window から継承した入れ子クラス |
|
クラス java.awt.Container から継承した入れ子クラス |
|
クラス java.awt.Component から継承した入れ子クラス |
Component.BltBufferStrategy, Component.FlipBufferStrategy |
フィールドの概要 |
クラス 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 |
コンストラクタの概要 | |
Dialog(Dialog owner)
空のタイトルおよび指定された所有者ダイアログを持ち、最初は表示されず、モーダルではない Dialog を構築します。 |
|
Dialog(Dialog owner,
String title)
指定された所有者フレームおよびタイトルを持ち、最初は表示されず、モーダルではない Dialog を構築します。 |
|
Dialog(Dialog owner,
String title,
boolean modal)
指定された所有者フレームおよびタイトルを持ち、モーダルであるかどうかを指定された、最初は表示されない Dialog を構築します。 |
|
Dialog(Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc)
指定された所有者フレーム、タイトル、および GraphicsConfiguration を持ち、モーダルであるかどうかを指定された、最初は表示されない Dialog を構築します。 |
|
Dialog(Frame owner)
空のタイトルおよび指定された所有者フレームを持ち、最初は表示されない、モーダルではない Dialog を構築します。 |
|
Dialog(Frame owner,
boolean modal)
空のタイトルおよび指定された所有者フレームを持ち、モーダルであるかどうかを指定された、最初は表示されない Dialog を構築します。 |
|
Dialog(Frame owner,
String title)
指定されたオーナフレームおよびタイトルを持ち、最初は表示されず、モーダルではない Dialog を構築します。 |
|
Dialog(Frame owner,
String title,
boolean modal)
指定されたオーナフレームおよびタイトルを持ち、モーダルであるかどうかを指定された、最初は表示されない Dialog を構築します。 |
|
Dialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
指定された所有者フレーム、タイトル、および GraphicsConfiguration を持ち、モーダルであるかどうかを指定された、最初は表示されない Dialog を構築します。 |
メソッドの概要 | |
void |
addNotify()
ネイティブスクリーンリソースに接続することにより、この Dialog を表示可能にします。 |
void |
dispose()
現在ブロックされている場合は、Dialog を破棄して show() を返します。 |
AccessibleContext |
getAccessibleContext()
このダイアログに関連した AccessibleContext を返します。 |
String |
getTitle()
ダイアログのタイトルを返します。 |
void |
hide()
現在ブロックされている場合は、Dialog を非表示にし、show() を返します。 |
boolean |
isModal()
ダイアログがモーダルであるかどうかを示します。 |
boolean |
isResizable()
ユーザがこのダイアログのサイズを変更できるかどうかを示します。 |
boolean |
isUndecorated()
このダイアログが装飾を持たないことを示します。 |
protected String |
paramString()
このダイアログの状態を表す文字列を返します。 |
void |
setModal(boolean b)
ダイアログがモーダルかどうかを指定します。 |
void |
setResizable(boolean resizable)
ユーザがこのダイアログのサイズを変更できるかどうかを設定します。 |
void |
setTitle(String title)
Dialog のタイトルを設定します。 |
void |
setUndecorated(boolean undecorated)
このダイアログの装飾の有効化と無効化を切り替えます。 |
void |
show()
ダイアログを表示します。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
public Dialog(Frame owner)
Dialog
を構築します。
owner
- ダイアログの所有者
IllegalArgumentException
- owner
の GraphicsConfiguration
が画面デバイスからのものでない場合
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless
が true
の場合は常にスローされるGraphicsEnvironment.isHeadless()
,
Component.setSize(int, int)
,
Component.setVisible(boolean)
public Dialog(Frame owner, boolean modal)
Dialog
を構築します。
owner
- ダイアログの所有者modal
- true
の場合、ダイアログが表示されているときは、ほかのアプリケーションウィンドウへの入力は不可
IllegalArgumentException
- owner
の GraphicsConfiguration
が画面デバイスからのものでない場合
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless
が true
の場合は常にスローされるGraphicsEnvironment.isHeadless()
public Dialog(Frame owner, String title)
Dialog
を構築します。
owner
- ダイアログの所有者title
- ダイアログのタイトル。null
値も指定可能であり、NullPointerException はスローされない
IllegalArgumentException
- owner
の GraphicsConfiguration
が画面デバイスからのものでない場合
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless
が true
の場合は常にスローされるGraphicsEnvironment.isHeadless()
,
Component.setSize(int, int)
,
Component.setVisible(boolean)
public Dialog(Frame owner, String title, boolean modal)
Dialog
を構築します。
owner
- ダイアログの所有者title
- ダイアログのタイトル。null
値も指定可能であり、NullPointerException はスローされないmodal
- true の場合、ダイアログが表示されたときは、ほかのアプリケーションウィンドウへの入力は不可
IllegalArgumentException
- owner
の GraphicsConfiguration
が画面デバイスからのものでない場合
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless
が true
の場合は常にスローされるGraphicsEnvironment.isHeadless()
,
Component.setSize(int, int)
,
Component.setVisible(boolean)
public Dialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc)
GraphicsConfiguration
を持ち、モーダルであるかどうかを指定された、最初は表示されない Dialog
を構築します。
owner
- ダイアログの所有者title
- ダイアログのタイトル。null
値も指定可能であり、NullPointerException はスローされないmodal
- true の場合、ダイアログが表示されたときは、ほかのアプリケーションウィンドウへの入力は不可gc
- ターゲットスクリーンデバイスの GraphicsConfiguration
。gc
が null
の場合は、同じ GraphicsConfiguration
を所有フレームとして使用
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless() が true の場合は常にスローされるGraphicsEnvironment.isHeadless()
,
Component.setSize(int, int)
,
Component.setVisible(boolean)
public Dialog(Dialog owner)
owner
- ダイアログの所有者
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless() が true の場合は常にスローされるGraphicsEnvironment.isHeadless()
public Dialog(Dialog owner, String title)
owner
- ダイアログの所有者title
- ダイアログのタイトル。null
値も指定可能であり、NullPointerException はスローされない
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless() が true の場合は常にスローされるGraphicsEnvironment.isHeadless()
public Dialog(Dialog owner, String title, boolean modal)
Dialog
を構築します。
owner
- ダイアログの所有者title
- ダイアログのタイトル。null
値も指定可能であり、NullPointerException はスローされないmodal
- true の場合、ダイアログが表示されたときは、ほかのアプリケーションウィンドウへの入力は不可
IllegalArgumentException
- owner
の GraphicsConfiguration
が画面デバイスからのものでない場合
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless
が true
の場合は常にスローされるGraphicsEnvironment.isHeadless()
public Dialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc)
GraphicsConfiguration
を持ち、モーダルであるかどうかを指定された、最初は表示されない Dialog
を構築します。
owner
- ダイアログの所有者title
- ダイアログのタイトル。null
値も指定可能であり、NullPointerException はスローされないmodal
- true の場合、ダイアログが表示されたときは、ほかのアプリケーションウィンドウへの入力は不可gc
- ターゲットスクリーンデバイスの GraphicsConfiguration
。gc
が null
の場合は、同じ GraphicsConfiguration
を所有ダイアログとして使用
IllegalArgumentException
- owner
の GraphicsConfiguration
が画面デバイスからのものでない場合
IllegalArgumentException
- owner
が null
の場合。この例外は GraphicsEnvironment.isHeadless
が true
の場合は常にスローされるGraphicsEnvironment.isHeadless()
,
Component.setSize(int, int)
,
Component.setVisible(boolean)
メソッドの詳細 |
public void addNotify()
Window
内の addNotify
Component.isDisplayable()
,
Container.removeNotify()
public boolean isModal()
true
、そうでない場合は false
setModal(boolean)
public void setModal(boolean b)
isModal()
public String getTitle()
null
の可能性もありsetTitle(java.lang.String)
public void setTitle(String title)
title
- ダイアログのボーダに表示されるタイトル。null の場合、空のタイトルが表示されるgetTitle()
public void show()
ダイアログがモーダルでまだ見えない場合、hide
または dispose
を呼び出すことによりダイアログを隠すまでは、この呼び出しは返されません。イベントをディスパッチするスレッドからモーダルダイアログを表示することができます。ツールキットでは、このメソッドを呼び出したスレッドがブロックされていても別のイベントポンプが実行されるためです。
Window
内の show
Component.hide()
,
Component.isDisplayable()
,
Component.validate()
,
isModal()
public void hide()
Window
内の hide
Window.show()
,
Window.dispose()
public void dispose()
Window
内の dispose
Component.isDisplayable()
,
Window.pack()
,
Window.show()
public boolean isResizable()
true
、そうでない場合は false
setResizable(boolean)
public void setResizable(boolean resizable)
resizable
- ユーザがダイアログのサイズを変更できる場合は true
、そうでない場合は false
isResizable()
public void setUndecorated(boolean undecorated)
undecorated
- 有効化できるダイアログ装飾がない場合は true
、ある場合は false
IllegalComponentStateException
- ダイアログが表示可能な場合isUndecorated()
,
Component.isDisplayable()
public boolean isUndecorated()
true
、持つ場合は false
setUndecorated(boolean)
protected String paramString()
null
にはなりません。
Container
内の paramString
public AccessibleContext getAccessibleContext()
Accessible
内の getAccessibleContext
Window
内の 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.