CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Dialogs

  1. #1
    Join Date
    Mar 2000
    Posts
    123

    Dialogs

    If I create a dialog box:

    int result = JOptionPane.showOptionDialog(MyApp.this, dlgObjects, "MyDialog", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, dlgOptions, dlgOptions[0]);

    where dlgObjects are simply my objects (labels, text boxes) and dlgOptions are my buttons:

    private Object[] dlgOptions = { "Save", "Cancel") };

    How do I:
    a) setMnemonic on the two option buttons?
    b) trap for enter key and invoke the button with focus?

    Thanks in advance :-)




  2. #2
    Join Date
    Sep 2000
    Posts
    3

    Re: Dialogs

    you cannot. JOptionPanes are fairly primative. you will have to build your own JDialogs to get this advanced behavior.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured