Skip to main content

How to display another Options Panel or any sorts of pop up in performOperation?

Comments

7 comments

  • Richard Moir

    Do your data fetching at the start of the performOperation method then use Dialogs.showDialog(...) to display the results. By default, this will cause the perform operation method to wait until the user closes the dialog then it will continue.

    0
  • Mark Miller

    That's displaying the retrieved data in a dialogue pop up right? Is there a way to display a JPanel that I designed myself.

    0
  • Richard Moir

    Yes, the message parameter to Dialogs.showDialog is type Object. You can pass any JComponent in as the message and it will be displayed.

    0
  • Mark Miller

    I see, thank you.

    0
  • Mark Miller

    I read the documentations for Dialogs and tried to implement what you suggested, but I kept on getting errors because I wasn't passing in the correct parameters. Would I have to create a DialogOptions Object to use this method? Or can I just use Options? Please see the attachments for the code that I'm working with.




    Screen Shot 2015-12-18 at 3.20.38 PM.png
    Screen Shot 2015-12-18 at 3.20.05 PM.png
    0
  • Richard Moir

    It looks like your DisplayGUIModel class could just extend JPanel directly, assuming it isn't being passed to Geneious as an options somewhere. There is no need to extend options otherwise.

    Then you can display it like this:

    DialogOptions dialogOptions = new DialogOptions(Dialogs.OK_CANCEL, "");
    Dialogs.showDialog(dialogOptions, displayGuiModel);

    If you do need to extend Options then you can display it using Dialogs.showOptionsDialog() instead. This method is trickier to use though because you need to invoke it on the event dispatch thread.

    0
  • Mark Miller

    Thank you, it works now.

    0

Please sign in to leave a comment.