• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Default Dialog

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can I have default standard dialog box in Java? (If I don't want to create Dialog object)
Thanks,
Angela
 
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java comes with several pre-defined dialogs, JOptionPanes. They're pretty easy to use. Give them some simple parameters and you've got a dialog! More on them can be found at:
http://web2.java.sun.com/docs/books/tutorial/uiswing/components/dialog.html#features
More on dialogs can be found at:
http://web2.java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Originally posted by Angela Jessi:
Hi,
Can I have default standard dialog box in Java? (If I don't want to create Dialog object)
Thanks,
Angela


 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Matt,
But I am restricted to use AWT.I don't want to use Swing. Any suggestions in AWT. Instead of initiating the object , if i can use standard dialog directly ?
Thanks again,
angela
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think I'm alone in wondering exactly what it is you are asking. Can you be a bit more clear exactly what you're trying to do?
Here is my best guess:
You want some default behaviour for a message type of dialog. Eg:

And the dialog that is presented already has an OK button, and a window closing 'X' that works, etc...
If this is the case, then write your own MsgBox class that extends Dialog, and use this new class, instead of Dialog.
But in any event, to make use of a class, you need to instantiate it, unless of course you make some static members/methods.

 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic