Change the OK Cancel string in JOptionPane

后端 未结 3 1653
情深已故
情深已故 2021-01-17 22:55

I was wondering is it possible to change the OK Cancel Button to custom string in java? I have

JOptionPane.showConfirmDialog(message, title, JOptionPane.OK_C         


        
3条回答
  •  盖世英雄少女心
    2021-01-17 23:30

    Look at the javadocs in the detailed class description part:
    You aren't limited to this set of option buttons. You can provide any buttons you want using the options parameter.
    What (options) is also described there. Anyway the default texts (i.e. OK/Cancel) are usually based on the computer locale, but for custom labels use the method described in the javadocs.

提交回复
热议问题