Questions tagged as 'java'

1
answer

Import java classes to a project automatically?

I wonder if there is any way to automatically import java classes from a given local directory to my current project. For example: Let's say that when I press an "Import" button in my application, all java classes that are in "c: / my folder / m...
asked by 10.03.2016 / 01:09
2
answers

Java constructor with array

I'm learning about constructors in java but I stuck in the exercise of college that seemed simple, the proposal is to create a class constructor with an array, and call it in another class to attribulate the values to array: Builder: public...
asked by 22.03.2016 / 02:14
2
answers

Possibility to schedule threads in Java to run at different times

I have a multithreading system that is the same as the post link - Java Thread Synchronization (synchronize collections) in Java that allows you to schedule threads to run at different times. In this way, the agendarTarefa...
asked by 23.12.2015 / 08:12
1
answer

How to implement Service Layer with Spring?

Does anyone know of any tutorial, examples ... any source to learn how to implement service layer?     
asked by 21.12.2015 / 15:48
1
answer

What are Java daemon threads and when to use them?

From the Java documentation I get the following snippet:    The Java Virtual Machine exits when the only running threads are all daemon threads. But it's still not clear to me when I should set a thread as a daemon or not. Would anyone ha...
asked by 18.12.2015 / 00:36
2
answers

Capture via ExceptionHandler

I'm trying to capture a javax.validation.ValidationException in my MB to play on an alert later. I tried with the three examples below independent but nothing returned. Should I enter any more code? I use version 2.5.0. @ViewController...
asked by 22.12.2015 / 13:26
1
answer

toString returning Null when it should not

I have the class Aluno . public class Aluno { private String nome; @Override public String toString() { return this.nome; } //metodos getters e setters } Class Vetor public class Vetor { p...
asked by 13.07.2016 / 14:39
1
answer

Search in associative table

How can I search the associative table? There are two entities, Person and Time. From where I created the associative Person_Time that has id_people and id_time. My goal is to list all the id_time of a certain people_id Next error: HTTP...
asked by 12.07.2016 / 16:18
1
answer

Use more than one variable in the same sentence (replace)

In a precise field, replace two words with another two words. Example: Sr (a) v1, the value of your invoice is v2 real. How to get: Mr Joao , your invoice amount is 10,00 . So, I have the following method below. String mensagemI = txt...
asked by 26.07.2016 / 13:27
4
answers

How to change the text color in a JTextPane?

I'm developing a chat and it uses JTextPane to display messages in different colors for each user. However, I'm not sure how I can change the text colors of this component. Example: We have two people (John and Peter), when I receive...
asked by 22.07.2016 / 21:41