{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Displaying Dialogs","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"displaying-dialogs","__idx":0},"children":["Displaying Dialogs"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"simple-info-warning-or-error-dialogs","__idx":1},"children":["Simple Info, Warning or Error dialogs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For displaying simple textual information, warning or error dialogs you can use the DialogManager utility class."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    import com.interactive.intviewerapi.util.DialogManager;\n    ...\n    DialogManager.getDefault().showMessageDialog(\"Please specify a positive number for the scale\", \"Editor Warning\", DialogManager.WARNING);\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For displaying dialogs that require a user interaction such as OK, YES or NO, use showConfirmDialog:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"   int resp = DialogManager.getDefault().showConfirmDialog(\"Do you want to continue ?\", \"Editor Warning\", DialogManager.OK_CANCEL_OPTION);\n   if (resp == DialogManager.OK) {\n        ....\n   }\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you have caught an exception and need to let the user know about the problem, you can also use:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    import com.interactive.intviewerapi.util.DialogManager;\n    DialogManager.getDefault().showErrorDialog(\"Could not create Seismic layer.\", \"Layer Error\", ex);\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The exception message will be displayed in the dialog."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more complicated dialogs, you should use IntViewerDialogDisplayer class which is based NetBeans DialogDisplayer functionality. This class help you with the creation and handling of standard dialog buttons including OK, Apply, Cancel, Help, etc."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"display-dialog-with-the-default-options-apply-ok-cancel","__idx":2},"children":["Display dialog with the default options. (Apply, OK, Cancel)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    import com.interactive.intviewerapi.util.DialogManager;\n    ...\n    IntViewerDialogDisplayer.getDefault().notify(contents, \"My Dialog Title\", new ActionListener() {\n        @Override\n        public void actionPerformed(ActionEvent e) {\n            if (DialogDisplayerUtils.OK.equalsIgnoreCase(e.getActionCommand())) {\n                // do something\n            }\n        }\n    });\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Where contents is a JPanel which contains the internals of your dialog."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"display-a-dialog-with-predefined-options","__idx":3},"children":["Display a dialog with predefined options"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you need a different combination of buttons, you can choose from some of the predefined ones in IntViewerDialogDisplayer."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    IntViewerDialogDisplayer.getDefault().notify(contents, \"My Dialog Title\",\n    IntViewerDialogDisplayer.SAVE_CANCEL_OPTION, new ActionListener() {\n    @Override\n    public void actionPerformed(ActionEvent e) {\n                // handle your buttons\n        }\n    });\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"display-a-dialog-with-custom-options","__idx":4},"children":["Display a dialog with custom options"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you need a combination that is not provided, you can try the following:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"     OptionType customOptions = new OptionType(new String[]{\"OK\"}, \"OK\", new String[]{\"OK\"});\n     IntViewerDialogDisplayer.getDefault().notify(contents, \"My Title\", customOptions, new ActionListener() {\n         @Override\n         public void actionPerformed(ActionEvent e) {\n            // handle events\n        }\n     });\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The first argument to OptionType specifies the list of buttons, the second the default button and the last the buttons that will close the dialog."]}]},"headings":[{"value":"Displaying Dialogs","id":"displaying-dialogs","depth":1},{"value":"Simple Info, Warning or Error dialogs","id":"simple-info-warning-or-error-dialogs","depth":3},{"value":"Display dialog with the default options. (Apply, OK, Cancel)","id":"display-dialog-with-the-default-options-apply-ok-cancel","depth":3},{"value":"Display a dialog with predefined options","id":"display-a-dialog-with-predefined-options","depth":3},{"value":"Display a dialog with custom options","id":"display-a-dialog-with-custom-options","depth":3}],"frontmatter":{"title":"Displaying Dialogs","pageId":"intviewer-apis-for-dialogs-and-editors/displaying-dialogs","seo":{"title":"Displaying Dialogs"}},"lastModified":"2026-10-22T14:32:05.575Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/intviewer/intviewer-apis-for-dialogs-and-editors/displaying-dialogs","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}