jeudi 9 août 2018

Why this short if doesnt work ? message.startsWith("www.")? JOptionPane.showMessageDialog(win, "Url is") :

I would like to fix this error,why this short if is not correct. a normal if() than another if does work for me.

 btn.addActionListener(new ActionListener() {               
@Override
   public void actionPerformed(ActionEvent arg0) {              
  String message = text.getText();

  message.startsWith("www.")? JOptionPane.showMessageDialog(win, "Url is") : JOptionPane.showMessageDialog(win, "Message");

and also how to change this enter image description here symbol in the JFrame window, to alert, exclamation mark (!), warning symbols? Thanks, Ea.

Aucun commentaire:

Enregistrer un commentaire