Questions tagged as 'java'

1
answer

onActivityResult does not return setResult

What happens is that I have an Activity Client where I have 2 buttons, one of register and another of query, when I call the register opens an Activity with a TabHost with 2 fragments inside, in the query opens an Activity with listView and such...
asked by 19.10.2015 / 21:54
1
answer

Error fetching a list from the bank

Hey, guys, So I have a question in my college work, I have two tables one USER and USER_AMIGO both related, by java I'm looking for a user list that brings all users registered, and another list that brings a friend to a certain user, so I...
asked by 16.10.2015 / 23:14
1
answer

Margin of a Document iTextPdf

I'm working with an existing PDF file, following the short line of code: //Código... document = new Document(PageSize.A4); PdfWriter writer = PdfWriter.getInstance(document, fOut); document.open(); PdfContentByte cb = writ...
asked by 19.10.2015 / 16:59
1
answer

Several buttons (JButton) with the same function in different JPanels

I'm doing a program (using the NetBeans GUI Builder and CardLayout) with several screens (various JPanels) and all of them will have a start button, which obviously returns to the home screen. I want to leave the code cleaner, so I created a...
asked by 18.10.2015 / 03:49
1
answer

One method of the controller works correctly and another similar one returns error

I have two Controller files and two JSP files with the same structure. In JSP I have the following structure for AJAX: $.ajax({ method: "POST", url: '/modulo1/funcao1', data: { 'atributo1': atributo1,...
asked by 20.10.2015 / 15:48
1
answer

How to convert TIMESTAMP / DATETIME to GregorianCalendar?

How do I convert a TIMESTAMP or DATETIME of MySQL into a GregorianCalendar of Java? Or a better idea? In the class, the dataCadastro field is of type GregorianCalendar . I'm writing to the database in typ...
asked by 24.08.2015 / 19:27
1
answer

Calling a JSF popup from a Managed Bean

I use this JavaScript to call a popup on JSF :    function showMyPage() { window.open('./showMyPage.xhtml','mywindow', 'resizable=no,toolbar=no,scrollbars=yes,height=450,width=530,top=145,left=235'); return true; } But,...
asked by 24.08.2015 / 18:34
1
answer

Am I abusing Strategy Pattern in Java?

In an application for user authentication via Radius I thought it would be interesting to use Design Patter Strategy with Enum. So the code looks like this: public enum TipoAutenticacao { LIVRE("Acesso Livre"){ @Override public Str...
asked by 15.10.2015 / 00:26
1
answer

Link model information to a ListView correctly

To retrieve an object from my domain from the AdapterView.OnItemLongClickListener event bound to my ListView I added to the ViewHolder of the adapter used by it a reference to my domain object. public static class ViewHolder { priva...
asked by 18.09.2015 / 02:30
1
answer

Validation of fields in java [closed]

How do I do a check in java SE for some data, to return a message and request this information again if it is incorrect, in an elegant way following good practices of object orientation?     
asked by 17.09.2015 / 21:16