Questions tagged as 'java'

1
answer

Error Building Json of an Object retrieved by Hibernate

Error constructing Json from an object retrieved by Hibernate. session.getTransaction().begin(); ArrayList<Cliente> lista = new ArrayList<>(session.createCriteria(Cliente.class).list()); String json = new Gson().toJson(list...
asked by 13.11.2014 / 15:08
1
answer

How to see if there are two equal items in the ArrayList and remove them?

I am doing the "Tokenization" of a TXT file. I need the code to save all tokens in an ArrayList, but there can be no duplicate token . I would like to know how to remove duplicate tokens , or check if token already exists and in this...
asked by 08.11.2014 / 15:43
1
answer

What is the purpose and where should I use "strictfp"

I was reading the Java 9 specification and I came across the keyword strictfp , l for what it's just that was not clear. What good is this and where should I apply? Why is not it so used in programs today? Why was not it removed...
asked by 21.12.2018 / 21:12
2
answers

How to 'increment' in variables

In the code below my variable y asks for the user to enter values until y reaches 10, I make the storage in the variable x and the last information entered is currently stored (which shows at the end of the code) what I would like to know it is...
asked by 06.10.2014 / 18:28
2
answers

Draw a pixel-by-pixel image

I'm trying to do a beast program but I can not do it. I want to redraw a pixel-by-pixel image randomly, doing this with multiple threads. I do not handle much of Java Swing, so I'm beating myself a lot. I did some research before postin...
asked by 09.10.2014 / 15:23
1
answer

Exception org.hibernate.PropertyAccessException: could not set a field value by reflection setter

I'm trying to map the following template in JPA with Hibernate: Company table: CREATE TABLE empresa ( id_empresa INT(11) NOT NULL AUTO_INCREMENT , PRIMARY KEY (id_empresa) ) ENGINE = InnoDB DEFAULT CHARACTER SET = latin1 ROW_FORMAT = FI...
asked by 08.10.2014 / 15:50
2
answers

How to insert a jTabbedPane into a jPanel of another class

How can I add a JtabbedPane of a class, into a jPanel of another class? Is it possible? In the 'ConfEmpresa' class I created a container and added the JtabbedPane called 'jTabConfCompany'. public class ConfEmpresa extends javax.swing.JFrame...
asked by 23.10.2014 / 12:50
1
answer

JavaFx Image Click event

I have an implementation being developed in JavaFx only I came across some situation that seem to be simple, when designating an Event the image on your OnMouseClicked from my FXML I get the following error: java.lang.IllegalArgumentException:...
asked by 17.10.2014 / 12:15
1
answer

Problem persisting: "Can not add or update a child row: a foreign key constraint fails ..."

Tables Contact CREATE TABLE IF NOT EXISTS 'sgct-database1'.'contato' ( 'contato_id' SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, 'telefone' CHAR(10) NOT NULL, 'celular' CHAR(11) NULL, PRIMARY KEY ('contato_id')) ENGINE = InnoDB AUTO...
asked by 14.07.2014 / 03:40
1
answer

Follow the SQL output in Java

My application in java for web gives the error of SQL Syntax several times, but only indicates a trick of the SQL script that gives error. Is there any way I can see the full script that was "played" in MySQL that gave error? Li...
asked by 15.07.2014 / 01:17