Questions tagged as 'java'

2
answers

Edit EditText with Dates Selector

How can I make it so that when I mark a date in the Date Selector it is added to the EditText? Code that I use for the Dates Selector: private void setAlarm(Uri passuri){ Calendar cal = Calendar.getInstance(); cal.set(datePicker.ge...
asked by 06.01.2017 / 18:34
1
answer

Chess board in java

I have been asked to create a chess board and now, all right, the problem arises when I want to give color to the boxes and I do not understand why. The code below creates the board, the problem is here: if((y+x+1)%2==0){ C...
asked by 20.07.2018 / 03:55
1
answer

Put bold on the system.out.println in java

I wanted to know if there is a way to put some words that are inside a System.out.println (); in bold or another text format. IN JAVA     
asked by 12.11.2018 / 07:05
2
answers

Problem in entering data by keyboard with java

I was trying to do this program, the main problem is that it only lets me enter the value I want to give to numeroN , then it does not let me write by console and in the summation I get that is equal to zero, I wanted to know if someone ca...
asked by 05.08.2018 / 01:16
1
answer

Initialize the reference of an array in the constructor? [duplicate]

public class Dados{ int numeros[]; Dados(){ numeros = {1,2,3,4,5,6}; } } NetBeans marks me an error. How can I initialize the array in the constructor?     
asked by 07.11.2018 / 20:46
1
answer

Syntax error in Java, MySQL

I have a syntax error in the following String and I do not know what is due. Nparte is of type int . String editSQL="UPDATE PARTESDETRABAJO SET DESCRIPCIONTAREA=?,"+"FECHAENTRADA=?,"+"FECHAENTREGA=?,"+"TIEMPOEMPLEADO=?"+"WHERE NPA...
asked by 06.06.2018 / 08:53
2
answers

It does not generate objects of a specific class

When I try to use this code I do not generate objects and when printing it says that it is empty. List<Question> questions = new ArrayList(); ChoicesQuestion q = new ChoicesQuestion(); ChoicesAnswer a = new ChoicesAnswer(); q.setText("La...
asked by 03.04.2018 / 02:04
3
answers

Can you split a String by a String string with a structure?

I collect the data from an xml that has 200 elements and within those elements is the date of each one, being its structure like this: 2018-05-04 00:00:00.0 2018-02-02 12:00:00.0 But for example there are others who instead of having on...
asked by 08.05.2018 / 10:25
1
answer

Any other way to code Base 64 on Android?

java.util.Base64 I want to encode the password to base 64, but I only found that class to code and decode, the problem is that it is only compatible from API 26 and as a minimum compatibility I use API 21     
asked by 02.05.2018 / 16:15
2
answers

How can random characters be generated with Math.random?

I am trying to generate license plates for random cars that autogenerate in the constructor of a car class. The license plates are composed of 4 digits and 3 letters. For example: 0001JFK, 2245HRY etc. How can I randomly generate letters and...
asked by 26.04.2018 / 13:24