Это довольно необычная JOptionPane, хотя ... Я надеюсь, что WebButton - это то, что расширяет JButton;
int o =JOptionPane.showOptionDialog(bcfiDownloadPanel,
new Object[]{panel},
"Authorization Required",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
new WebButton[]{new WebButton("OK"), new WebButton("Cancel")}, // this is the array
"default"
... так что, как и для любого JButton, вы должны добавить к нему прослушиватель действий, чтобы он соответствовал событию щелчка и т. Д .;
измените ваш код следующим образом:
int o =JOptionPane.showOptionDialog(bcfiDownloadPanel,
new Object[]{panel},
"Authorization Required",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
new WebButton[]{this.ok, this.cancel}, // this is the array
"default"
Отчет, который помогает
Удачи