Questions tagged as 'java'

1
answer

Using ProgressBar

I would like to know how to create a progressBar where, when you click a button to open another screen, the progressBar is showing, and when you open the other screen, the progressBar exits the screen. How do I do that? I already have the two sc...
asked by 21.09.2017 / 15:29
1
answer

How to check if fields are empty before adding in arraylist? [duplicate]

I have a question: how could I check if the fields in my JTextFields are empty before adding in arraylist ?, how would validation be in this part of code? Endereco enderecoPJ=new Endereco(); PessoaJuridica pes...
asked by 20.09.2017 / 02:18
1
answer

@DateTimeFormat with daylight saving time day with error

I'm having a problem converting date from 10/15/2017 (start of daylight savings time) My mapping looks like this: @Column(nullable = false) @NotNull @DateTimeFormat(pattern = "dd/MM/yyyy") private Date dataVisita; When processing the req...
asked by 17.10.2017 / 15:31
3
answers

Import one .java into another .java [closed]

I have 2 codes: Code 1: class Principal { public static void main(String[] args){ Pessoas pessoa1 = new Pessoas(); pessoa1.idade = 1; pessoa1.nascimento = 2; pessoa1.altura = 0.5; pessoa1.nome = "texto"; } } Code 2: class Pessoas {...
asked by 22.10.2017 / 18:12
2
answers

Problem in recovering data from firebase

I recently started working with Firebase and am still learning what can be done by reading the available documentation. But one problem I'm having is in recovering the data inside a function. The problem in question is that to recover data from...
asked by 03.11.2017 / 11:07
2
answers

Check Android Internet [duplicate]

To check the connection to the internet I did the following method. public class ChecaInternet extends AsyncTask<Void, Void, Boolean> { @Override protected Boolean doInBackground(Void... params) { boolean success = false; try...
asked by 26.05.2017 / 21:11
2
answers

JPA spring boot custom data does not work

public interface ProdutoRepositorio extends JpaRepository<Produto, Long> { @Query(value="SELECT new br.com.thiago.objcustom.SomaDosProdutos(e.nome, sum(preco)) FROM sitethiagodois.produto p inner join sitethiagodois.empresa e on e...
asked by 28.03.2017 / 04:56
3
answers

Error in "switch case"

I have an error in one of the case s of switch , the error is this: I'mdoingaCRUDfromalibrary,whenyouseethecode,youmightfinditstrange:I'vemadesomeswitchwithonly1option,becauseeachoptionleadstoadifferentmenu@OverridepublicintMenu...
asked by 28.06.2017 / 21:13
1
answer

Run parallel code snippets

Hello, I wanted to know how to execute one thread after another for a certain time, for example: Thread x = new Thread(() -> { // qualquer código, pode ter até um while(true)... }); Thread x2 = new Thread(() -> { // qualquer código, pode...
asked by 11.06.2017 / 22:46
2
answers

Error java.lang.NoClassDefFoundError

I'm stuck on a project that should be a "bank" with a CRUD account and transaction. I have to use Oracle database because of the facul. This error happens when giving an insert in the database. Stacktrace: jun 11, 2017 4:21:58 PM com.sun.f...
asked by 11.06.2017 / 21:41