Questions tagged as 'java'

2
answers

As a condition if an EditText is empty or not within an Intent.EXTRA_TEXT on Android?

I have a function that sends an email, the data that goes inside the mail are loaded by the user in the app, they are a series of fields of EditText , now what I need to do is within this Intent.EXTRA_TEXT condition if a field is em...
asked by 13.03.2018 / 18:02
1
answer

Exchange between color format in java

In a program I am extracting the color of a certain bit of an image with the method: import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; BufferedImage image = null; image = ImageIO.read(new File(dir)); fo...
asked by 11.03.2018 / 15:25
1
answer

Delete java.lang.NullPointerException problem

What I try to do in this program is to pass a file that contains a series of tables as if it were an excel and to fit the data in the code so that the data is printed in the same way in java.lang. NullPointerException that I get at the end of my...
asked by 11.03.2018 / 21:41
1
answer

How can I call an array that is inside a method to another method within the same class?

This is what I've been doing so far public class Proyecto_progra1 { public static void main(String[] args) { String opcion; int num = 0; do{ opcion = JOptionPane.showInputDialog("1- Nombre de conductores.\n" +"2-...
asked by 10.03.2018 / 02:59
1
answer

Compare values between two HashMap

I have two HashMap in my code HashMap<Long, Double> partesTrabajoIdHorasDb = new HashMap<>();//ID+horas HashMap<Long, Double> partesTrabajoIdHorasLocal = new HashMap<>(); The first Hashmap    par...
asked by 06.03.2018 / 17:09
1
answer

How to read data from a .csv file and save only some in an arraylist

I am reading a .csv file as follows BufferedReader rd = new BufferedReader( new FileReader ("C:/Users/user/Documents/running-example.csv")); String line = null; ArrayList lista = new ArrayList(); while ((line = rd.r...
asked by 26.02.2018 / 19:39
1
answer

The data is not shown in my table and the window is closed when trying to open it (it is a fragment)

This is my Logcat W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView I/Timeline: Tim...
asked by 27.02.2018 / 14:04
1
answer

Socket JAVA not local

I have an application where I open a socket; server = new ServerSocket(25000, 1, InetAddress.getByName("localhost")); And a client that connects to him; private Socket socket; this.socket = new Socket("localhost", 25000); The program w...
asked by 22.02.2018 / 12:39
1
answer

Get JSON data with GSON in Java

I need to get the data progress and tres (see example below) but I do not know how. Also in some occasions I will have to recover more data of the type class without knowing in advance how many will be. I'm looking at...
asked by 20.02.2018 / 18:33
1
answer

Problems with the connection to mysql with java

My problem is that my java application generates too many connections without control. In the first instance I thought it was because I was not closing the connections correctly, but the problem is not solved. Any other option to be able to clos...
asked by 23.02.2018 / 15:10