Questions tagged as 'java'

2
answers

How do I access the indexes of a vector returned by a method in java?

I have a method called vetorVoos that returns a vector of type NodeVoo and I want to access the contents of that vector through the method in another class. This is the method: public NodeVoo[] vetorVoos(){ if(isEmpty()){...
asked by 04.05.2014 / 01:03
2
answers

Doubts object orientation + java ORM

I want to store the data of my program via ORM and I'm separating each object nicely. My User object, for example, has its basic attributes and is also composed of other objects such as Address, Contact and Access. Each object has an ID at...
asked by 24.04.2014 / 15:30
1
answer

How to get the value of the lazy attribute of the first datatable in the Bean?

To get the value of the selectionMode attribute of the datatable (primefaces) in MB: DataTable dt = (DataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent("IdForm:IdDataTable"); String sm = dt.getSelectionMode(); A...
asked by 16.04.2015 / 16:45
1
answer

How to persist abstract class with JPA

I know JPA and I have other tables already implemented and working. I would like to know how to persist the classes below, since one is an abstract class and the other is "extending" it. Should I put annotations and properties as if...
asked by 08.04.2015 / 21:09
1
answer

Problems with new in Java

Why every time I use new in my class, for example: if(e.getSource() == levelButton) { new PainelNivel().setVisible(true); } Java runs this command ie it shows the class LevelDraw and opens the class from where this command was...
asked by 27.04.2015 / 06:37
1
answer

How do I get a resource that is in the same package as the class that will use it?

I've created a Java project with the following structure: src |-br.foo.settings | |- settings.json | |- Settings.java | |- ... outros pacotes ... As I'm accustomed to the JSON file format, I thought I'd create one to set the...
asked by 18.04.2015 / 04:05
1
answer

Convert PDF to DOC

Is it possible to convert a PDF to a word document by keeping all formatting, alignments, fonts and tables in the converted document using apache-poi or some other api?     
asked by 22.04.2015 / 17:01
1
answer

Reading PDF with DefaultStreamedContent. How to close it?

I have a JSF page where I generate a PDF and need to show it on the screen. For this, I created a <p:media> It's working, but the PDF file gets stuck (it's never closed) and over time it ends up dropping Tomcat by Many file...
asked by 08.04.2015 / 16:10
1
answer

Demoiselle @Transactional Usage

I'm having trouble using the @Transactional annotation of Demoiselle. When I was controlling the transaction "on hand" with a% injected%, it was all right. But now using EntityManager , the record is inserted into the database, but I get...
asked by 23.04.2015 / 13:03
1
answer

Chick Escape - Backtracking Problem

I'm implementing a problem in Java. The problem consists of a NxN tray, where a chicken and X wolves are placed. I get the size of the board, the position of the chicken, the number of wolves and the position of the wolves via standard input, so...
asked by 18.11.2014 / 12:47