Questions tagged as 'java'

1
answer

Relationship of classes by collections in JPA2

In a bean that has a OneToMany link, with others, through a HashMap what annotations should be used? @Entity class Rodada{ public HashMap<Pergunta,Resposta> perguntas;     
asked by 29.09.2014 / 21:27
2
answers

How to convert an EntryString element, Integer to String?

I'm using: List<Map.Entry<String,Integer>> lista = new ArrayList<Map.Entry<String,Integer>>(fila); And I do some operations after that part .. After I do these operations, I need to put each "object" of the list in a...
asked by 26.09.2014 / 01:22
2
answers

Run loop again

Code: while (digita != 4){ System.out.println("Digite o o número referente ao tamanho da(s) pulseira(s)\n1.Pequena (17cm) - R$180,00\n2.Média (18cm) - R$200,00\n3.Grande (20cm) - R$240,00\n4.Prosseguir para escolha de pingentes."); dig...
asked by 29.03.2015 / 16:19
1
answer

What is the difference between the following methods?

I'm developing an application in JSF and I came across the following methods and want to know the difference between them. ((HttpSession)FacesContext.getCurrentInstance() .getExternalContext().getSession(false)).invalidate...
asked by 29.03.2015 / 19:03
1
answer

How to position a component near the Windows clock?

I learned that to center a component in the center of the screen just use: frame.setLocationRelativeTo(null); But how do I display the component on top of the Windows clock regardless of screen size? In my case my code looks like this:...
asked by 28.03.2015 / 13:28
1
answer

assign a function to a key on the keyboard [duplicate]

I am creating an application for a cattle auction where it has a lot, the animal's gender, whether it is the view or the term, and the value field of the lot where it increases, while the auctioneer speaks the bid. Getting typed value manual...
asked by 26.03.2015 / 21:22
1
answer

JAVA chained lists

How to invert a simple chained list in Java? For example, I have the following values: 3 - 2 - 1 and the end result will have to be 1 - 2 - 3. Note: without using native Java functions such as ArrayList. public void inverteLista() { Lis...
asked by 26.03.2015 / 00:04
1
answer

I can not include the artifacts by Maven

I have little experience with Java programming and I'm having a hard time including libraries by Maven, and I do not know if it's really necessary to create a local Maven repository on my computer, as shown in the video below: link I'm f...
asked by 13.08.2014 / 13:45
1
answer

Button to add a new field

I'm creating an application that calculates the average of 3 numbers, so long, but now I wanted to create a '+' button that at the time I clicked on it it would add a new field and make that calculation with the fourth and so on but I did not fi...
asked by 11.09.2014 / 20:48
1
answer

Mark (colorize) a string to write to the file

My application searches for a few words in a file. When the program recognizes these words (strings), it should mark it. For example: changing the font color or changing the background color of the word. Then I will write the same text, but w...
asked by 18.08.2014 / 14:42