List of usage examples for com.squareup.okhttp FormEncodingBuilder FormEncodingBuilder
FormEncodingBuilder
From source file:practica2.Pila.java
private void btnPopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPopActionPerformed RequestBody formBody = new FormEncodingBuilder().add("numero", "").build(); String r = getString("pop", formBody); System.out.println(r + "---"); }
From source file:practica2edd.Cola.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("dato", jTextField1.getText()) .add("operacion", "insertar").build(); String a = getString("cola", formBody); System.out.println(a);//w w w . j a v a2 s. c o m }
From source file:practica2edd.Cola.java
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("dato", jTextField1.getText()) .add("operacion", "extraer").build(); String a = getString("cola", formBody); System.out.println(a);//from w ww .j a va 2s.c o m }
From source file:practica2edd.Lista.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("dato", jTextField1.getText()) .add("operacion", "insertar").build(); String a = getString("lista", formBody); System.out.println(a);//w w w. j a va 2 s .c o m }
From source file:practica2edd.Lista.java
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("dato", jTextField2.getText()) .add("operacion", "eliminar").build(); String a = getString("lista", formBody); System.out.println(a);/*w ww . j av a2 s.c o m*/ }
From source file:practica2edd.Lista.java
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("dato", jTextField3.getText()) .add("operacion", "buscar").build(); String a = getString("lista", formBody); System.out.println(a);//from w w w. j a v a 2 s . c o m }
From source file:practica2edd.Matriz.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: // Texto//w w w. j ava 2 s . com boolean arroba = false; String a = jTextField1.getText(); int intIndex = a.indexOf("@"); if (intIndex != -1) { arroba = true; } else { arroba = false; } if (arroba == false) { JOptionPane.showMessageDialog(null, "Correo invalido"); } else { String dominio; String correo = ""; String letra = ""; String nombre = ""; correo = jTextField1.getText(); StringTokenizer tokens = new StringTokenizer(this.jTextField1.getText(), "@"); nombre = tokens.nextToken(); dominio = tokens.nextToken(); System.out.print(dominio); letra = Character.toString(nombre.charAt(0)); RequestBody formBody = new FormEncodingBuilder().add("dato", dominio).add("dato5", letra) .add("dato6", nombre).add("dato7", correo).add("dato2", "matriz").add("dato3", "agregarm") .build(); String r = getString("metodoWeb", formBody); System.out.println(r); jTextArea1.setText(jTextArea1.getText() + "\n" + r); jTextField1.setText(""); } }
From source file:practica2edd.Matriz.java
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: boolean arroba = false; String a = jTextField2.getText(); int intIndex = a.indexOf("@"); if (intIndex != -1) { arroba = true;/*from w w w. j av a 2s. co m*/ } else { arroba = false; } if (arroba == false) { JOptionPane.showMessageDialog(null, "Correo invalido"); } else { String dominio; String correo = ""; String letra = ""; String nombre = ""; correo = jTextField2.getText(); StringTokenizer tokens = new StringTokenizer(this.jTextField2.getText(), "@"); nombre = tokens.nextToken(); dominio = tokens.nextToken(); System.out.print(dominio + letra + nombre + correo); letra = Character.toString(nombre.charAt(0)); RequestBody formBody = new FormEncodingBuilder().add("dato", dominio).add("dato5", letra) .add("dato6", nombre).add("dato7", correo).add("dato2", "matriz").add("dato3", "borrarm") .build(); String r = getString("metodoWeb", formBody); System.out.println(r); jTextArea1.setText(jTextArea1.getText() + "\n" + r); jTextField1.setText(""); } }
From source file:practica2edd.Matriz.java
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed // TODO add your handling code here: if (jTextField3.getText().equals("")) { JOptionPane.showMessageDialog(null, "Texto vacio"); } else {// w w w.ja va2 s . c om String letra; letra = jTextField3.getText(); RequestBody formBody = new FormEncodingBuilder().add("dato", "").add("dato6", "").add("dato7", "") .add("dato2", "matriz").add("dato3", "buscarl").add("dato5", letra).build(); String r = getString("metodoWeb", formBody); System.out.println(r); jTextArea1.setText(jTextArea1.getText() + "\n" + r); jTextField1.setText(""); } }
From source file:practica2edd.Matriz.java
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed // TODO add your handling code here: if (jTextField4.getText().equals("")) { JOptionPane.showMessageDialog(null, "Texto vacio"); } else {/* w w w.ja v a 2s . c om*/ String dominio; dominio = jTextField4.getText(); RequestBody formBody = new FormEncodingBuilder().add("dato", dominio).add("dato6", "").add("dato7", "") .add("dato2", "matriz").add("dato3", "buscard").add("dato5", "").build(); String r = getString("metodoWeb", formBody); System.out.println(r); jTextArea1.setText(jTextArea1.getText() + "\n" + r); jTextField1.setText(""); } }