Questions tagged as 'java'

4
answers

Error refreshing table in XHTML (Primefaces JavaWeb)

I have a problem loading a table from a MySQL database. The table is in PrimeFaces and loads the data from the database when I deploy the application. But when I modify a data, even though it loads it into the database, it does not show it in th...
asked by 07.06.2016 / 21:24
1
answer

Error with Fragments: "java.lang.IllegalStateException: FragmentManager is already executing transactions"

I'm having a small problem when creating fragments, it's that I get an Exception as if getSupportFragmentManager was already running. The error:    E / AndroidRuntime: FATAL EXCEPTION: main                     Process: jhon.casique.baccus,...
asked by 22.10.2016 / 18:15
1
answer

Problem when creating JSONObject in android studio

I am creating a login in Android Studio guiding me from a tutorial but I have been stuck, when creating a JSONObject there is something that fails and I do not know what it is. I have managed to create a String with the valu...
asked by 18.02.2018 / 00:36
1
answer

Sort a List of Objects in Java

I have a list of my own Java objects, which need to be sorted by the property code of the object itself. List<Calle> listaDeCalles; Calle calle1 = new Calle(); calle1.setCodigo("A4"); ... listaDeCalles.add(calle1); l...
asked by 14.10.2016 / 13:24
1
answer

List Order

My query is as follows: I have a list of objects where each one receives a latitude and longitude. Using a CustomAdapter I show the objects and with a method I calculate the distance between my position and that of the list to show how many kilo...
asked by 23.11.2017 / 14:06
2
answers

Match a letter at the beginning of the string

I made the following code: import java.util.regex.Matcher; import java.util.regex.Pattern; import java.lang.Math; // headers MUST be above the first class // one class needs to have a main() method public class HelloWorld { // argum...
asked by 12.05.2017 / 22:45
3
answers

Can I get the name of the instance of a class?

I do not know if the question is well written but this is the question. I have my class ProductosLacteos . When I create the instance I do this: ProductosLacteos quesito = new ProductosLacteos(); Then I want to get quesito a...
asked by 26.04.2017 / 20:01
2
answers

Differences between file reading classes

I have some doubts about the FileReader / bufferedReader and FileWritter / BufferedWritter classes, since I do not have very clear in which moment it is better to use one or the other.     
asked by 18.05.2017 / 07:24
2
answers

Create database and tables from java

I am developing a SaaS and I am in the database part, what I want to do is create a database in postgresql for each client that registers but I do not know how to create them from java since the code that I have is the next: CREATE DATABASE "I...
asked by 20.12.2016 / 16:27
1
answer

Find a character that is not a space or a letter, including accents and diacritics of Spanish

I want to include the space and only accept letters, numbers and accents and the special character > ñ . What I have done is the following: if (primernombre.length() == 0 || a.matches(".*[^a-zñáéíóúA-ZÑÁÉÍÓÚ].*")) { primerno...
asked by 04.01.2017 / 16:12