我已經嘗試過其他主題,所以請不要將我發送給另一個主題/教程,因爲我沒有設法理解它並且我嘗試過。如果你不幫忙,請不要回復。使用JOptionPane刪除窗口的取消按鈕
I would like to change this code to display only "OK" and delete the cancel button.
Object contestacion5 = JOptionPane.showInputDialog(null, "#5 Que describe mejor a la Norteña?", "Examen Tijuanas PR", //3
JOptionPane.DEFAULT_OPTION, null,
new Object[] {"Ensalada de espinacas, tomates, zetas, cebolla, tocineta, aguacate, queso de hoja y tiras de maiz crujientes en vinagreta de la casa.",
"Lechuga romana servida con tomate, cebolla, maiz, aguacate, queso de hoja y tiritas de maiz crujientes acompañado de su seleccion de filetes de pollo de res.",
"Ensalada vegetariana de nopales, tomates, cebolla, lechuga romana, queso de hoja, aguacate, y aderezo especial de la casa." }, null);
這是圖片,我想這正是因爲這一點,但沒有取消按鈕,謝謝!
我試圖做這樣:Is there a way to only have the OK button in a JOptionPane showInputDialog (and no CANCEL button)?
,這就是它顯示:
分享您用來嘗試在你表現出的鏈接方法的代碼。這非常簡單,出了什麼問題? –
另請參閱:請不要轉發您的問題。改善你的舊的;這個會被標記爲重複。 http://stackoverflow.com/questions/18946681/i-would-like-to-change-this-code-to-display-only-ok-and-delete-the-cancel-butt –
-1'所以請做不要發送給我另一個主題/教程,因爲我沒有設法理解它並且我嘗試過。如果你不幫忙,請不要回復。「 - 我指出你的教程有一個實例。由於您的代碼不起作用,您顯然沒有閱讀教程或從實際示例開始。我們不是在這裏舀食物併爲你寫代碼。強迫你閱讀教程並嘗試這些例子對你有幫助。如果你不學習閱讀和遵循例子,你將無法編程。 – camickr