Questions tagged as 'java'

1
answer

How to implement my program in Java to be Multithread? [closed]

My program is not running properly, I can start the server but it does nothing else. I want to be able to write a message in the program and have the same message in response. This is the client code: import java.net.Socket; import java.lan...
asked by 04.12.2016 / 01:04
1
answer

Why are not you entering this if / else? [duplicate]

I run this code and if / else if are not entering. What can it be? import java.util.Scanner; public class VerificaLetra { public static void main(String[] args) { String sexo = " "; String letra; Scanner scan;...
asked by 28.02.2017 / 17:34
1
answer

Primefaces: Modal dialog does not open

I'm trying to open Dialog from primefaces, but to no avail. I have the following code: Registered Clients.xhtml: ... <ui:define name="content"> <h:form id="frm-clientes-cadastrados"> <p:button value="Novo Cliente"...
asked by 25.02.2017 / 21:33
1
answer

Send String via Java socket

I have my Client and Server classes. I want to send the StringString store to the server. I have already tried several methods but the error or it sends an empty String to server. Can anyone give me a light of what I'm doing wrong? public clas...
asked by 26.02.2017 / 01:34
1
answer

Update a textview for a few seconds

I wanted to implement a transition between two Activitys, where the user would see a Progress Bar (already implemented) and a textview where every 2 seconds, a new phrase appears to me, for example: Loading information ... Implementing the...
asked by 28.02.2017 / 20:14
1
answer

Multiple data in an ArrayAdapter

To make a list with a data with ArrayAdapter I do so: ArrayList<String> palavras = new ArrayList<>(); int a = 0; for(int i = 0;i<50;i++) { a++; palavras.add(Integer.toString(a)); } ArrayAdapter<String> adapter = n...
asked by 27.02.2017 / 18:07
1
answer

I can not / know how to use the Setter [closed]

I'm trying to do some testing in JAVA here and I'm having problems: Product class, with initialization and getters/setters public class Produtos { private String[] nomeItem = {"Item 1","Item 2","Item 3","Item 4","Item 5"};...
asked by 23.12.2016 / 18:42
1
answer

Push Button Effect

I have several buttons in an application and I wanted them to have the same effect of Button when pressed, because they are several buttons, I would like to create a code in JAVA for this and not by the States into XML as it would have...
asked by 23.12.2016 / 21:48
1
answer

Error "Unable to instantiate activity" when executing Activity

My application has a home screen, where the user can select the registration screen. However, it is only me because of the gets that it stops working with this error below, it does not even show the registration activity. The error is...
asked by 21.11.2016 / 00:56
1
answer

Save only if it is not null

How do I map with Hibernate @OneToOne and save only if the information has data in the related table? Example: public class ObservacaoPessoa { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer id;...
asked by 16.02.2017 / 13:30