9 cm604.75

360 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
360
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

9 cm604.75

  1. 1. Dialog Box 1
  2. 2. ObjectiveOn completion of this period, you would beable to know• Dialog box 2
  3. 3. RecapIn the previous class, you have leant•Menu bars and menus 3
  4. 4. Dialog Box• Dialog boxes are primarily used to obtain user input• They are similar to frame windows, except that dialog boxes are always child windows of a top- level window• Dialog boxes don’t have menu bars
  5. 5. Dialog Box contd..• Dialog boxes may be modal or modeless• Modal means – Focus is always on the current dialog box
  6. 6. Dialog Box contd..• Two commonly used constructors are shown here – Dialog(Frame parentWindow, boolean mode) – Dialog(Frame parentWindow, String title, boolean mode) – Here, parentWindow is the owner of the dialog box. If mode is true, the dialog box is modal – Otherwise, it is modeless
  7. 7. swings Struts jdbc hibernate home java previous question papersOCT/NOV-2012 QUESTION PAPER April / May 2012 c-09 October/ November-2011 c-09 April/ May 2011 c-09 April/ May 2011 c-05 Home 7
  8. 8. Methods of Dialog Box• Commonly used methods – void show() • Shows the dialog – String getTitle() • Returns the title of the dialog – void setTitle(String title) • Sets the dialog title – boolean isModal() • Checks whether the dialog is modal or not
  9. 9. Methods of Dialog Box contd..• void setModal(boolean flag) – Sets the current dialog to modal• boolean isResizable() – Returns whether the dialog is resizable• setResizable(boolean flag) – Sets the dialog to be resizable
  10. 10. Example Programimport java.awt.*import java.awt.event.*;public class DialogDemoextendfs Frame{ public DialogDemo{ setTitle(“MyDialog”); setSize(250,200); setVisible(true); Dialog myDialog = new Dialog(this,”Dialog”); myDialog.setSize(150,100: myDialog.show(); }
  11. 11. Example Program contd.. public static void main(String args[]){ new DialoDemo(); }}
  12. 12. Summary• In this class we have learnt – Different constructors of Dialog – Methods of Dialog class – Example program
  13. 13. Quiz1. The method useful for setting a dialog to be modal a) getModal() b) setTitle() c) setModal() d) isModal()
  14. 14. Frequently Asked Questions1. List and explain the constructors of Dialog class2. List and explain the methods of dialog class
  15. 15. swings Struts jdbc hibernate home java previous question papersOCT/NOV-2012 QUESTION PAPER April / May 2012 c-09 October/ November-2011 c-09 April/ May 2011 c-09 April/ May 2011 c-05 Home 15

×