Questions tagged as 'java'

2
answers

Save to an ArrayList, the previous items are repeated

I have the following code to fill in a table, however when entering a second time information and save it, when the method updates the list, the data is duplicated, for example: If I enter Juan and save it shows Juan only, but at enter another n...
asked by 11.06.2016 / 04:15
3
answers

How to convert String to Date MySQL on Android?

Hello I have a question about how is the best way to convert a string to date in android fechauso = (EditText)findViewById(R.id.txt_fechadeuso); String fechausoo = fechauso.getText().toString(); I want to convert it to date because as I hav...
asked by 08.06.2016 / 21:34
2
answers

How to call specific fields Firebase Database Android

Good morning, I have this model private Button verdosis, verhipo; private String Lista="dosis"; private String lis2="Hipoglucemia"; private TextView textViewf,textViewhipo; FirebaseDatabase database = FirebaseDatabase.getInstance(); FirebaseD...
asked by 26.09.2018 / 18:45
2
answers

Apply to a variable of class A the value of an attribute of class B

I am with a problem in the development of a Java program, I need to set in a varibale of a class Menu the value set to an attribute of the Logica class. Logica class public class Logica { public static boolean administrador = false;...
asked by 12.10.2018 / 23:20
1
answer

How can I do a try catch and repeat the option I am doing?

System.out.println("Ingrese tipo de cuenta \n1. corriente\n2.Ahorro"); tipo=Integer.parseInt(entrada.readLine());//-->> How could I do that for example here you have to enter a number but if you enter with a letter that the try...
asked by 10.08.2018 / 15:03
1
answer

Because when compiling in NetBeans does not return anything to me?

I am doing a sum and octal conversion of two numbers, but when compiling it does not do the operation. I am calling the methods of my class from the main. I could not find my error. I leave my code (eye that I am starting in this) package octa...
asked by 09.08.2018 / 01:38
2
answers

Error with array in java

When creating a new Array B from an array% Co_of% previously filled, when making modifications to the array A are also reflected in the array B I explain myself in the following code: BufferedReader br = new Buff...
asked by 27.07.2018 / 05:23
1
answer

What is the path to a file located in the raw folder in android studio?

I would like to get the path to the file "datos.txt" located in the folder "raw" in "res", in Windows it would be something similar to "app / res / raw / data", but I can not get it to work. I've already tried it with the String path = "a...
asked by 26.08.2018 / 23:03
1
answer

How would you erase a line ex: "position 6" in a .txt file or in a String string?

Try several ways but I can not do it. One of them would be this and I get an error: try { java.io.BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("Archivo.txt")); bufferedWriter.append("Esto es la linea 1");...
asked by 29.08.2018 / 00:37
1
answer

How to add a placeholder in a JPasswordField

As the title of my question indicates, I am trying to add a placeholder in a JPasswordField, however it could be said that I have achieved it halfway. What I have done so far is to use the following code (which I adapted from an answer I foun...
asked by 16.07.2018 / 21:03