• Like
9 cm604.75
Upcoming SlideShare
Loading in...5
×
Uploaded on

 

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
136
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Dialog Box 1
  • 2. ObjectiveOn completion of this period, you would beable to know• Dialog box 2
  • 3. RecapIn the previous class, you have leant•Menu bars and menus 3
  • 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. Dialog Box contd..• Dialog boxes may be modal or modeless• Modal means – Focus is always on the current dialog box
  • 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. 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. 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. 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. 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. Example Program contd.. public static void main(String args[]){ new DialoDemo(); }}
  • 12. Summary• In this class we have learnt – Different constructors of Dialog – Methods of Dialog class – Example program
  • 13. Quiz1. The method useful for setting a dialog to be modal a) getModal() b) setTitle() c) setModal() d) isModal()
  • 14. Frequently Asked Questions1. List and explain the constructors of Dialog class2. List and explain the methods of dialog class
  • 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