Questions tagged as 'java'

1
answer

Pattern Builder Multiple Returns

I have a class builder that is responsible for returning an object it builds: public class ObjetoBuilder { private Objeto objeto; public ObjetoBuilder() { objeto = new Objeto(); } public ObjetoBuilder adicionarId(...
asked by 28.09.2018 / 13:53
1
answer

Merge RowFilter.andFilter with RowFilter.orFilter

I have a project that has a table and items to be filtered. They are a JComboBox category, a JTextField , and a JDateCooser date range. I made all the filters separately with RowFilter.andFilter and now I need to put them...
asked by 11.11.2018 / 14:30
1
answer

Problem trying to encrypt and decrypt using RSA

Hello, I'm doing a program that encrypts a user-generated file and then decrypts the encrypted file showing the original message. It's like the RSA implementation code of Bouncing Castle but saving the files. I'm just not able to pass encry...
asked by 11.11.2018 / 23:05
1
answer

Java JfileChooser doubt code

I understand that here I instantiate the class JFileChooser : JFileChooser arquivo = new JFileChooser(); I get the object from the file and call the method of class JFileChooser (correct me if I'm wrong): arquivo.setDialogTit...
asked by 11.11.2018 / 23:03
1
answer

How to create a business rule by JPA?

I need to implement a business rule that ensures that the same employee represented by the Employee table can not be added more than once to the same project represented by the Project table. Let me give you an example; Let's assume we ha...
asked by 17.09.2018 / 21:11
1
answer

Error sending pdf to FirebaseStorage

I'm trying to send pdf files to the Firebase Storage and with this code I get to the point of getting the Uri, send, but only falls on onFailure, follow the code @Override public void onClick(View v) { if (Conte...
asked by 18.09.2018 / 08:01
2
answers

How do I stop a sum?

I'm making an app where I have to pull a sensor (I used the accelerometer) and save the sum of the 3 parameters. When I try to save this sum the app hangs, I find that the save command is causing it to crash, does anyone know what's wrong?...
asked by 21.09.2018 / 15:24
1
answer

How to get html code through a url in android studio

I would like to do as I get an html code from a website using android studio. This is the code I made, but it will not return anything. private static String pegarURL(String a) { StringBuilder b = new StringBuilder(); try { UR...
asked by 22.09.2018 / 19:47
1
answer

How do I execute the getCity () method with asynctask, and return the value of the string city to use in another method?

public class CadAnuncio extends AppCompatActivity { LocationManager locationManager; private Button btnSalvar; private DatabaseReference databaseAnuncio, databaseUsuario; private String uid, url, url02, url03, url04, url05,...
asked by 19.09.2018 / 14:53
1
answer

Referencing Activity Components

I searched but found no answer. I need to access a TextView that is present in my Activity within a Java Class that is independent of the Java Class of Activity itself. The form I tried was creating a reference: pub...
asked by 18.10.2018 / 20:22