Error configuring JOptionPane message dialog buttons

I get an error: no suitable method found for showMessageDialogwhen I try to configure the showMessageDialog button to say "Start" instead of "OK".

This is the code:

JOptionPane.showMessageDialog(frame, radioPanel, "Start Game", JOptionPane.PLAIN_MESSAGE, null, new String[]{"Start"});

Can anyone please indicate why I can get this error.

Thanks in advance

+4
source share
1 answer

There are 3 overloads showMessageDialog:

You are trying to call this method with 6 arguments, so no one is applicable. You need to carefully read the documentation to decide which one you need.

+5
source

All Articles