Search code examples
javapluginsjoptionpanextext

Plugin development - JOptionPane Warning message is too small


I am developing a plugin for my language I created using xtext. In my plugin I need to show a warning message in some case. This is my code:

    JOptionPane.showMessageDialog(null, "Unable to Extract", "Warning", JOptionPane.WARNING_MESSAGE);

This is how it's look: enter image description here This is very small, why it's happening and how I can fix it?


Solution

  • You could use SWT/JFace instead of Swing. But i still doubt it is a good idea to show the same warning

    • During Editing
    • During Build

    And it might not work in standalone mode or headless mode since there is no ui then.

            Display.getDefault().asyncExec() [
                MessageDialog.openWarning(Display.current.activeShell, "xxx", "yyyy")
            ]