Questions tagged as 'java'

2
answers

Caught in the try catch [duplicate]

Pressing a button on my program is always caught in catch The error that I get when executing the program is as follows E/editarcontacto: null java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.Arra...
asked by 14.11.2018 / 13:36
1
answer

Doubt about Try-Catch nested in Java

This is a little doubt about the logic of having a Try-Catch inside another Try-Catch in Java, for example it would have something like this: try{ //codigo aqui try{ //Aqui ocurre el error }catch(Exception ex){ System.out.prin...
asked by 14.11.2018 / 21:34
1
answer

how can I optimize this algorithm? [closed]

   Read 9 whole numbers store them in a matrix.   Find out how many numbers are cousins and which are perfect numbers import java.io.*; import javax.swing.JOptionPane; public class matriz1 { private static int matriz[][] = new int [3][3];...
asked by 12.11.2018 / 05:04
1
answer

How to rotate a wave in Processing?

I am new in Processing and I need to turn all this wave PI / 8 with respect to its horizontal axis, I have tried with rotate () and translate () but I can not do it because everything is dismantled. Somebody help me please? I leave the code here...
asked by 11.11.2018 / 21:36
2
answers

How to limit a JTextField in Java? [duplicate]

There are many questions about the use of these functions and events here clarify the doubts. However there are many ways to achieve this limitation.     
asked by 13.11.2018 / 16:31
1
answer

Open a URL in the background

I have a method to dynamically create objects of type MenuItem based on a list of operations that I have created. Within that method I have the following FOR loop: for(OperacionConfigurableDTO oc : this.plantillaPrincipalFichaPacienteVM.g...
asked by 13.11.2018 / 10:52
1
answer

Xpath with java, extract name

I'm starting with Xpath in java and I'm trying to get information from xml tags through Xpath queries. I can not articulate a query that shows me the name of people with a weight over 100. So far the code I have is :: package ejemplo_xpath;...
asked by 23.10.2018 / 12:27
3
answers

Android Studio 3.1.3 recognizes as "null my images"

When I try to reference an image from the code of an activity I get the problem:    java.lang.RuntimeException: Unable to start activity   ComponentInfo {com.example.deybin.figuremapsearching / com.example.deybin.figuremapsearching.MainActivi...
asked by 22.10.2018 / 02:52
2
answers

Hello, I would like to know why the form (in java) shows the data in null

//Aquí guardo los datos ingresados por teclado private void botonGuardarActionPerformed(java.awt.event.ActionEvent evt) { if (txtNombre.getText().equals("")) { JOptionPane.showMess...
asked by 22.10.2018 / 07:01
1
answer

In Java: What is the difference between a variable of type int, and one of type double?

I was doing a program that tried to calculate pi, but java gave me an error:    Error: possible loss and conversion from double to int I solved it by changing all my variables to the double type, but I was curious about the difference   ...
asked by 04.11.2018 / 20:39