Questions tagged as 'java'

1
answer

Display an image with Java Swing JLabel

I'm trying to display an image in an app using Swing Java. I get some frames from a video and display them as images. private void updateView(){ Image tempCurrent = imageProcessor.toBufferedImage(currentImage); currentImageView.set...
asked by 14.03.2017 / 20:52
2
answers

No Netbeans works, no Jar

I know you have some similar topics, but none answers my question. I created a program to insert information into the database and it works perfectly when I send netbeans to compile. I made Jar, and when I use the program from Jar, nothing...
asked by 15.03.2017 / 05:23
1
answer

How to map entities with composite keys in JPA?

I have a system where all tables in the database have a column empresa , which is part of PRIMARY KEY . In the client table, I have a column id (autoincrement), which together with empresa form a composite key, mappe...
asked by 09.04.2017 / 23:57
2
answers

Error with popular array with Double

I need to put in a array of double the data of the quantity field that comes from the database. When doing this with the following code: static List<Historico> listaComCincoUltimosMeses = new ArrayList<Historico> ();...
asked by 11.05.2017 / 21:00
1
answer

Method that returns Java date / time

After searching several posts related to the subject, I did not find an example where I create an "external" class (other than main for example) and main call the method that gives me the updated time automatically. I have used the following w...
asked by 12.05.2017 / 21:44
1
answer

Preventing an attribute from being serialized or deserialized

I'm using Gson in a web service and I need to prevent some attributes from being serialized and others that are prevented from being deserialized. One of the reasons for preventing a serialization is due to the loop that is entered when serializ...
asked by 11.05.2017 / 15:10
1
answer

LinkedList in Java

First, I have a LinkedList called LinkedEventos. LinkedList<Eventos> LinkedEventos = new LinkedList<Eventos>(); Subsequently, I have an assignment LinkedEventos = Compra; . Does anyone know to tell me what such an assignme...
asked by 03.03.2017 / 19:40
1
answer

How do I sort string in the Insertion sort method?

I'm using the following method, however in the WHILE line it's error. Netbeans says    "bad operand types for binary operator" & & ", first type: boolean, second type: int". public boolean insertionSort(String a []) { if (a...
asked by 05.03.2017 / 02:46
1
answer

IllegalAccessException when reading values with reflection

I can not read the values of the class attributes with reflection: ContentValues values = new ContentValues(); Field[] fields = this.getClass().getDeclaredFields(); for (Field field: fields ) { field.setAccessible(true);...
asked by 04.03.2017 / 20:22
2
answers

Problem with code in Java

Personal I'm doing a basic Java program. At the moment has 6 classes, however, is having problem in 2 classes at the time of registration. I'm doing a SET to register the player's name in the threaded list and then in case 6 I'm trying to print...
asked by 18.05.2018 / 01:47