Questions tagged as 'java'

2
answers

Connection problems between Hibernate and MySQL database [closed]

Hello, I'm starting Hibernate studies and I'm not making a MySQL database connection. Here's my code below: import java.util.Calendar; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; impor...
asked by 24.01.2017 / 15:29
3
answers

How to convert Date to integer in java?

When I use this code: Date data = new Date(); SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy"); int dataAtual = Integer.parseInt(formatador.format(data)); System.out.println(dataAtual); This error appears: E...
asked by 15.09.2017 / 21:20
2
answers

Pass product list to another Activity [duplicate]

Hello, I'm learning and I wanted your suggestion, in a simple way at the beginning, of how to make this transition of products to another Activity. The application I'm developing it loads a list of products from a WebService, so in the applica...
asked by 20.09.2017 / 22:27
1
answer

Remove subArray from a Main Array

I have two main Arrays ( listaInformacoesNota , listaInformacoesPedidosPostgreSQL ) with N subArrays each, these subArrays have items in common and a different item only, I did the following to compare these each subArray: fo...
asked by 15.09.2017 / 14:12
1
answer

How do I retrieve a line in my jTable?

I would like to know how to retrieve information from a line of my JTable , follow the line of code of it. Usuarios operacao = new Usuarios(); DefaultTableModel tabela = new DefaultTableModel(); private void adicionarLinhas(String nome,...
asked by 08.12.2016 / 00:08
1
answer

Close Open Dialog within the RecyclerView Adapter

I made a header for my RecyclerView which, when clicked, opens a Dialog. Some time later, it started to give this error: Activity com.mypkg.myP has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44c46ff0 that was o...
asked by 06.12.2016 / 04:51
1
answer

Program that reads 3 numbers with repeat structure with scanner class!

How to make an algorithm in Java that reads 3 numbers and gives the mean? I know how to do without using repeat structure, but how to do with repeat structure? Here is my code below, but it does not have the expected result: public clas...
asked by 15.11.2016 / 01:25
2
answers

Validate text before going to the screen

I have the following dataTable : <p:dataTable id="tabela" var="c" value="#{geracaomb.lista}" paginator="true" rows="10" rendered="#{not empty geracaomb.lista}" paginatorPosition="top"> <p:...
asked by 16.11.2016 / 16:23
1
answer

Java array: no value

I'm having a small problem regarding an array that I am trying to develop to get coordinates inside a JFrame and pass them to position the buttons correctly. Here is the code: public class Coordenadas { //coordenadas int posic...
asked by 19.11.2016 / 04:50
1
answer

Convert ISO-8859-1 string to UTF-8 in java

My goal is to create a converter from ISO-8859-1 to UTF-8 . I already have the following code: import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.Input...
asked by 30.11.2016 / 13:23