Questions tagged as 'java'

1
answer

How do I grab each JSON object, add it to a list and show it in activity?

I have to develop an ecommerce app and I have a question regarding lists. I'm getting a JSON with some product data from an API and I'm trying to grab each object from that JSON, put it in a list and show each product with its data in an Activit...
asked by 15.10.2017 / 20:45
1
answer

Clear the form after registration (JavaServer Faces)

After you have made a registration, it clears the form normally, but when I turn the page and come back to the registration page, the fields are filled with the values that I registered earlier. The scoped I'm using is the @ViewScoped. Regist...
asked by 06.09.2017 / 16:41
2
answers

Subquery in Java HQL

Hello, I'm in a project that uses geolocation and I'm doing a feature to list the stores closest to the location chosen by the user. I'm using the PostgreSQL database and did this query to perform the search: SELECT ID, CIDADE, CNPJ, DESCRICA...
asked by 07.09.2017 / 22:31
1
answer

Duvida Exercises Collections - Interface Queue

Personal I have a question in this exercise about Collections where I should use the Queue interface: Write a program that simulates control of an airplane runway at an airport. In this program, the user must be able to perform the following...
asked by 12.09.2017 / 21:38
1
answer

How to list users and their "Roles"

Hello! I need to list users' access level on my Users Lookup page. But I can not access Role data through User. The User entity has the Role attribute that is mapped with the ManyToMany annotation, like this: @ManyToMany(cascade = CascadeType....
asked by 12.09.2017 / 20:02
1
answer

Attempt to invoke virtual method 'long ContactID.change (Contact)' on a null object reference [closed]

Error: 09-12 14:05:28.662 10410-10410/costamilam.guilherme.contatosempresariais E/AndroidRuntime: FATAL EXCEPTION: main Process: costamilam.guilherme.contatosempresariais, PID: 10410 java.lang.NullPointerException: Attempt to invoke virtual me...
asked by 12.09.2017 / 19:21
1
answer

Read xml in Java

I'm using a program called Tiled (TileMap) to generate a map and I want to read those numbers. The xml is like this: <?xml version="1.0" encoding="UTF-8"?> <map version="1.0" tiledversion="1.0.2" orientation="orthogonal" renderorde...
asked by 12.09.2017 / 20:40
2
answers

Algorithm that reads three numbers and displays the result of the sum of the first two and multiplied by the third

public class Exercicio2 { @SuppressWarnings("unused") public static void main(String[] args) { Scanner entrada = new Scanner(System.in); int i = 0; int[] soma = new int[3]; int numero1, numero2 = 0; int total = 0;...
asked by 05.09.2017 / 10:16
1
answer

Eclipse Debug Configuration

Good afternoon. I have a problem debugging my project in Eclipse. Native classes of java are appearing in the debugging process when the only classes that interest me are those that are part of my project. How do I choose not to view native J...
asked by 04.09.2017 / 21:19
1
answer

Check if you have reached the last row of the table

I am using this code to do an approved or disapproved check, but when it arrives on the last line, it is not checking if it is on the last line and does not give me the result. I would like to know how to check if you have reached the last...
asked by 03.10.2017 / 03:44