4
當我試圖自定義showMessageDialog按鈕來說「開始」而不是OK時收到錯誤:no suitable method found for showMessageDialog
。定製JOptionPane消息對話框按鈕時出錯
這是代碼:
JOptionPane.showMessageDialog(frame, radioPanel, "Start Game", JOptionPane.PLAIN_MESSAGE, null, new String[]{"Start"});
有人能指出爲什麼我可能會收到此錯誤。
在此先感謝
沒有'showMessageDialog'將接受六個參數。看看這個文檔https://docs.oracle.com/javase/7/docs/api/javax/swing/JOptionPane.html#showMessageDialog(java.awt.Component,%20java.lang.Object,%20java.lang。字符串%20int,%20javax.swing.Icon) –