Questions tagged as 'java'

2
answers

In MySQL how should the data types be declared in case of using the following elements in JAVA

1) If you are going to create a password with JPasswordField, what type of data should be declared in the SQL database ... would it be varchar or another? I understand that the passwords are encrypted and ask for another type of data. 2) In t...
asked by 18.05.2017 / 01:41
2
answers

event onclick on a spinner

I'm doing an activity that uses a spinner to enable several options but within the spinner I want to put an event onclick to communicate with a button in the activity and this performs an operation. This is the code. pu...
asked by 13.05.2017 / 03:17
1
answer

how to send a String to a method?

Hello, I started to see java in the university and we are looking at files and they gave us to try a method to which we only have to send a String that will be the name with which the file will be saved if it is easy but Mark me an error, the me...
asked by 07.04.2018 / 01:36
1
answer

Android 'setText' for X seconds

In my activity I call a setText : tvdato.setText(String.valueOf("BIEN")); I would like to know a method to make it provisional, that is, to last for a few seconds drawn on the screen.     
asked by 22.05.2017 / 08:12
1
answer

wanted to know how to put 2 fixes in 1 [duplicate] array

Here in my program it only takes 1 array that is the a but the b does not take it: c     
asked by 23.05.2017 / 23:42
1
answer

Repeated values in JSON

I'm loading some values in JSON and I would like to control and delete the duplicates: public void loadEventos(){ SharedPreferences prefs = getSharedPreferences(getString(R.string.gamedata), Context.MODE_PRIVATE); String data=prefs...
asked by 29.06.2017 / 08:01
2
answers

How to have a sentence repeated until it is correct

I would like to know how I can make the code repeat until it is correct, in this case greater than 400hrs /** * Metodo para obtener las horas de vuelo del piloto, con validacion de mayor a 400. */ public int HorasVuelo(){ Scanner sc = ne...
asked by 10.12.2017 / 04:11
3
answers

Error in JAVA creation of arrayList incompatible types: String can not be converted to branch ----

What does the error mean and how can I solve it? It is a database of a bank in which I have to use a type "branch" but I can not use it add that type To My arrayList ArrayList Array_Asesores = new ArrayList(); Here is the code porfavorrr .....
asked by 07.12.2017 / 15:07
2
answers

Problem with hours and minutes

hello with all I have the following code in java to capture the time and minutes, the code works, it returns me the time and the minutes of the system but, in hours and minutes less than 10 it returns me only a digit without including the zero t...
asked by 05.09.2018 / 21:18
2
answers

Error with java exceptions

I'm fighting with this java code about exceptions. What I want to do is create a method that validates if the arguments that happen are correct, but make the exception. the problem is that this leads me to add an exception in the setter, and...
asked by 25.05.2017 / 18:57