lundi 24 juillet 2017

i want select an item from the combo box and open another frame according to the selected item when I click a button

I tried this code but it is not working, And there are no errors in the code.In here next means my button.

private void nextActionPerformed(java.awt.event.ActionEvent evt) {

     int value=select.getSelectedIndex(); //select means my combo box
    if("image file".equals(value)){

        ImageCrypto im=new ImageCrypto();
        im.setVisible(true);
        this.dispose();

    }else if("text file".equals(value)){
        TextCrypto im=new TextCrypto();
        im.setVisible(true);
        this.dispose();
    }
 }

Aucun commentaire:

Enregistrer un commentaire