Page 2 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :, , , , Dialog boxes are pop-up windows on the screen that, appear for a small time to take either input or display, output while a main application is running., , , , The windows that appear for a brief time are known as, transient windows., , DJ Sir
Page 3 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :, , , , Dialog boxes are generally used to draw special attention, of the user like displaying warnings., , , , Dialog box is a top-level window that comes with a border, including a title bar. Unlike Frame, dialog box doesn't have, maximize and minimize buttons and have the default, layout manager is BorderLayout which can be overridden., , DJ Sir
Page 5 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :, , , , There are two Types of Dialog windows -, , , , Modal Dialog window: When a modal dialog window is, active, all the user inputs are directed to it and all the, other parts of application are inaccessible until this, model dialog is closed., , DJ Sir
Page 6 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :, , , , There are two Types of Dialog windows -, , , , Modeless Dialog window: When a modeless dialog, window is active, the other parts of application are still, accessible as normal and inputs can be directed to them,, without needing to close this modeless dialog window., , DJ Sir
Page 7 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :, , , , A dialog box works within a main program. It cannot be, created as a standalone application., , , , It is a child window and must be connected to a main, program or to a parent window., , , , Frame is a parent window as it can work independently., , DJ Sir
Page 8 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :Constructors, , , , Dialog(Frame owner)- Constructs an initially invisible,, modeless Dialog with the specified owner Frame and an, empty title., , , , Dialog(Frame owner, boolean modal)- Constructs an, initially invisible Dialog with the specified owner Frame, and modality and an empty title., , DJ Sir
Page 9 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :Constructors, , , , Dialog(Frame owner, String title)-Constructs an, initially invisible, modeless Dialog with the specified, owner Frame and title., , , , Dialog(Frame owner, String title, boolean modal)Constructs an initially invisible Dialog with the specified, owner Frame, title and modality., , . Sir, DJ
Page 11 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :Methods, , , , void setModal(boolean modal)-Specifies whether this, dialog should be modal., , , , void setResizable(boolean resizable)-Sets whether this, dialog is resizable by the user., , , , void setTitle(String title)-Sets the title of the Dialog., , DJ Sir
Page 12 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :Methods, , , , void setVisible(boolean b)-Shows or hides this Dialog, depending on the value of parameter b., , , , void show()-Deprecated. As of JDK version 1.5,, replaced by setVisible(boolean)., , DJ Sir
Page 13 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , DialogBox :Example, , DJ Sir
Page 14 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , FileDialog:, , , , The FileDialog class provides a File Open or Save, dialog box enabling us to access the local file system., , , , The FileDialog class of Java is OS dependent and calls, operating system's specific Open File dialog box or, Save dialog box. The advantage of this is that the users, of Java program will see familiar screens., , DJ Sir
Page 15 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , FileDialog:Constructor, , , , FileDialog(Frame parent)-Creates a file dialog for, loading a file., , , , FileDialog(Frame parent, String title)-Creates a file, dialog window with the specified title for loading a file., , DJ Sir
Page 16 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , FileDialog:Constructor, , , , FileDialog(Frame parent, String title, int mode)Creates a file dialog window with the specified title for, loading or saving a file., , , , The mode values are:, , , FileDialog.LOAD, , , , FileDialog.SAVE, , DJ Sir
Page 17 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , FileDialog:Methods, , , , String getDirectory()-Gets the directory of this file, dialog., , , , String getFile()-Gets the selected file of this file dialog., , , , int getMode()-Indicates whether this file dialog box is, for loading from a file or for saving to a file., , DJ Sir
Page 18 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , FileDialog:Methods, , , , void setDirectory(String dir)-Sets the directory of this, file dialog window to be the specified directory., , , , void setFile(String file)-Sets the selected file for this file, dialog window to be the specified file., , , , void setMode(int mode)-Sets the mode of the file, dialog., , DJ Sir
Page 19 :
1.4 Use of Layout Managers: DialogBox & File, Dialog, , , FileDialog: Example, , DJ Sir