Not really, I am working within a project for a network company. I am reading sent and received bytes from a specific port of a switch. So, I am thinking here to create a thread for each port for reading the data continuously and that is the purpose of start button. stop button will stop that thread which is typed in the text field. display button will read the thread which is typed in the text field and read the value of the bytes of that port.
I created a ThreadFactory pattern for each button which I think I don't need it for one of them.
click on start button will create a thread and I put it into a hashMap.
click on display button will search the hashMap for that thread and suppose to read the bytes for that port.
I think creating threads for each port of the switch that because of the counter for a port will reset (starts again from zero) when the bytes reached for that port 4GB. So, creating a thread for a port will keep reading the bytes.
is my approach reasonable?
and BTY, I read the last tech tip of
MultiThreading in Swing it used another approach for handling event dispatch thread and that by using Timer class.