private void btnConfirmActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnConfirmActionPerformed if (!txtUsername.getText().equals("") && !txtPassword.getText().equals("")) { BaseItems.UserItem currentUserItem = new BaseItems.UserItem(txtUsername.getText(), txtPassword.getText(), false); BaseXMLCommand<String, String, BaseItems.UserItem> command = new BaseXMLCommand<>("CreateUser", null, currentUserItem); _runClient.sendQuery(Command.Encoder(command)); BaseXMLCommand<String, String, String> response = Command.Decoder(_runClient.getResponse()); if (response.getValue().toString().equals("true")) { JOptionPane.showMessageDialog( this, "Registrazione effettuata con successo!", "Registrazione utente", JOptionPane.INFORMATION_MESSAGE); this.setVisible(false); } else { JOptionPane.showMessageDialog( this, "Errore durante la registrazione! Riprova!", "Registrazione utente", JOptionPane.ERROR_MESSAGE); } } else { JOptionPane.showMessageDialog( this, "Devi compilare correttamente tutti i campi!", "Registrazione utente", JOptionPane.ERROR_MESSAGE); } } // GEN-LAST:event_btnConfirmActionPerformed
@Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.preferences) { Intent p = new Intent("android.intent.action.PREFS"); startActivity(p); return true; } if (id == R.id.clearScreen) { clearScreen(); rc.sendObjectToServer("clearTheScreen"); return true; } return super.onOptionsItemSelected(item); }