Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Default Dialog

 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Matt Senecal
Ranch Hand
Posts: 255
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic