Questions tagged as 'thread'

0
answers

I can not update jframe from a java Thread

I have a code that reads the serial port through a thread, but when I try to update a label I can not. I implemented a SerialRead Runnable class, and in that class I execute a loop to read the serial port. So far so good, I can read the serial p...
asked by 30.11.2015 / 21:43
0
answers

TimerTask calling method twice

I have a TimerTask that calls a method every 1 minute, but the method is called twice. This method checks for some factors and sends an e-mail, as the method is called twice, and the e-mail is sent twice. Does anyone know where the proble...
asked by 17.07.2015 / 14:53
0
answers

Error running JavaFx TimerTask

I'm trying to run a task every 1 minute. The task is executed however when it arrives in the right minute to perform the action of this exception:    java.lang.IllegalStateException: Not on FX application thread;   currentThread = Timer-0...
asked by 16.07.2015 / 20:40
1
answer

My Thread only runs 2 times [closed]

I have a method that takes several files from a directory the lists in a table and generates a report for each file. I put a thread in this method and now it just picks up 2 files and stops. Where I might be going wrong: Method: private vo...
asked by 28.05.2015 / 15:12
0
answers

Problem with thread, interrupt and synchronism [closed]

The class Main does this: synThread tm = new synThread(); Person objPersont = new Person(); //input_file is used to read bytes from an input file FileInputStream input_file = new FileInputStream(input_file_path);;...
asked by 23.11.2014 / 22:58
0
answers

how to perform all tasks at the same time? [closed]

I can not get it to execute all these tasks at the same time, it only executes the rest when it receives some data in InputStream . And after receiving this data he does not receive any more. Help me please, I'm newbie and I've tried sever...
asked by 01.12.2014 / 00:27
2
answers

Memory competing and sharing between threads

I have the following code: class Objt { public List<t> list_t1; public List<t> list_t2; public Objt() { // faz inicializações } public void handleLists(List<t> list) { for(t e: l...
asked by 02.07.2016 / 21:49
1
answer

how to hide a progressBar after a certain time

I'm using the following code new Thread(new Runnable() { public void run() { while (cont < 100) { cont += 1; try { Thread.sleep(20); } catch (Interr...
asked by 11.06.2017 / 22:44
1
answer

Split Array into Multiple Threads

I need to make a Query in my Database, which will return each of the Lines. However, for each of them, during the Retorno, I have to wait about 5 seconds, because it is the time that I have to wait for Ping to complete and return to me if the Ho...
asked by 23.11.2018 / 01:28
2
answers

What is wrong with my thread using synchronized - Java

I started to study tread I saw some examples of java7 and java8 using lambda, I came in a part to use the synchronized which is to type a waiting list of threads where the next one and executed after a finish, I am testing but not I'm getting mu...
asked by 15.10.2017 / 00:15