Questions tagged as 'java'

1
answer

How do I calculate Euclidean distance

I have a class Ponto : public class Ponto { public int x; public int y; public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; }...
asked by 11.04.2014 / 16:35
2
answers

How to deserialize Json Springboot webservice

I'm trying to consume the themoviedb webservice and am encountering the following error. ----------------------- POJO ----------------------- -     package com.wsemovie.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @...
asked by 20.12.2018 / 01:04
0
answers

Send Parameter Together Json

I need to make the jsonrequest() function also send the codigo parameter so that it searches only the same data in the MYSQL database. Android function: private void jsonrequest() { request = new JsonArrayRequest(JSON_UR...
asked by 21.12.2018 / 18:23
1
answer

Return treated message when it occurs (com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException :)

Hello, good afternoon! Can someone help me to return a treated message when it occurs ** com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Can not delete or update parent row: a foreign key constraint fails ( loja...
asked by 08.09.2018 / 19:20
1
answer

How to handle the null values of a vector in the conversion from String to Double?

I need to display the top 10 contract rescission clauses, which are in a vector, extracted from a CSV file. Here, when I refer to contract rescission clauses, I mean monetary values (money), more precisely for fine of termination of contract....
asked by 09.09.2018 / 06:12
1
answer

Catching CPU usage in percentage

How to get CPU usage in percentage in java? The closest I came to was this code I tried to adapt, but it shows different results compared to the Windows task manager follow below package teste; import java.io.File; import java.lang.man...
asked by 03.10.2018 / 16:47
1
answer

Withdraw in the editor of Android Studio

How do I get this automatic design from Android Studio?     
asked by 04.10.2018 / 15:38
1
answer

Error getting time with row.getCell ()

I'm getting data from a worksheet in excel. public void Hora() Cell horaAgen = null; if(row.getCell(7) != null ){ horaAgen = row.getCell(7); System.out.println("hora: "+horaAgen); } } In the worksheet this: 9:00...
asked by 03.10.2018 / 20:18
1
answer

Print list attribute of a class in xml [closed]

How can I generate an xml file in java, from a class that receives an ArrayList as an attribute. I am not able to access the Arraylist indices when I move to the string that will be saved in xml.     
asked by 09.08.2018 / 18:38
2
answers

how to push the button using code, using the same effect as when the user presses

I am doing the game for java and when starting the machine will give a random click drying on 4 buttons and then the user has to press the same as the machine, but I do not know how to make the machine push the button package gênius; import j...
asked by 18.05.2016 / 06:17