Questions tagged as 'java'

2
answers

How do I make a log file in which I save every event that I want from my system?

What I have is the following: Logger logger = Logger.getLogger("MyLog"); FileHandler fh; try { fh = new FileHandler(file_log); logger.addHandler(fh); SimpleFormatter formatter = new SimpleFormatter(); fh.setFormatter...
asked by 28.08.2017 / 20:18
2
answers

Problem with accents in Regex

I am using the website link . Using the phrase as a regular expression: (?i)purificación And as a text PURIFICACIÓN To my surprise they do not machean, I thought that the case insensitive (i) modifier would solve this, but it does n...
asked by 10.08.2016 / 11:35
2
answers

java.lang.StackOverflow when using recursion

I'm doing a function that prints the percentage of the process, which ends when the counter reaches the target amount, but always throws me the following error: Exception in thread "main" java.lang.StackOverflowError at pruebas.Bucles.recu...
asked by 02.06.2017 / 00:05
2
answers

Click on a button in a listview to have an activity open

I have this ListviewAdapter and I would like to know how I can add an equal button to each item in the list, that when I press it, I will be directed to another activity. public class ListViewAdapter extends BaseAdapter { // Declare Variables...
asked by 03.06.2017 / 17:16
2
answers

Using lambda expressions in Java

I am practicing Lambda expressions and I have the following. I have a person class: private static class Persona { public int a; public String b; public Persona(int a,String b){ this.a=a; this.b=b; } pub...
asked by 16.05.2017 / 06:06
2
answers

Should obsolete methods be used in Java?

In some cases I have used methods that are marked as obsolete, however everything works correctly, but I do not know if that could affect the execution of the code with the passage of time due to Java updates.     
asked by 12.05.2017 / 17:39
2
answers

Error when obtaining the value of a variable

I have a problem with obtaining the data of a variable, It happens that I am doing a function that at the end of accounts must sumar of one on the initial value of the variable "n" , but I only get it to show by screen the initial v...
asked by 23.04.2017 / 04:05
3
answers

Check that read-only fields have not been modified

I am using spring-mvc and I have a form in a jsp, in this form there are fields that are read only, imagine that we have to make a payment and a field is the amount, I would like to know how I can do to verify that the read-only fields have not...
asked by 06.03.2017 / 20:44
1
answer

Error in java "java.util.ConcurrentModificationException"

Because I reason this exception error when using the iterator in this line: /*if((itTrayectos.next().getIdEinicial() == idEInicial) && (itTrayectos.next().getIdEfinal() == idEFinal))*/ package Grafos; import java.io.*; import java.uti...
asked by 12.12.2016 / 21:15
2
answers

"keytool" is not recognized as an internal or external command, program or batch file executable

I am trying to implement Firebase in my Android Studio application and since I want to use Firebase Auth I need the SHA-1 signature certificate, and to get it I need to execute this code in the CMD: keytool -exportcert -list -v \ -alias androi...
asked by 06.08.2017 / 07:06