JL9
JL9

Reputation: 543

Error when customising JOptionPane Message Dialog Buttons

I'm receiving the error: no suitable method found for showMessageDialog when trying to customise a 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"});

Could someone point out why I might be receiving this error.

Thanks in advance

Upvotes: 4

Views: 49

Answers (1)

Paul Boddington
Paul Boddington

Reputation: 37645

There are 3 overloads of showMessageDialog:

You are trying to call this method with 6 arguments, so none apply. You need to carefully read the documentation to decide which one you require.

Upvotes: 5

Related Questions