0
I will start a project where I will do the control of queues in java, normal queues even, as if you arrive at the bank and see on the screen your name.
I’ll give a summary of the project to be clearer.
I have 10 computers, each one belongs to one person, these people request something simultaneously. In another jframe it will display who requested it first, it will display the name of the person and the time that the person requested, as soon as it is answered the name of the person is removed from the queue, for example:
Solicitante | Tempo que fez a solicitação
João | 2:45
Roberto | 1:58
Olivia | 0:50
Pedro | 0:15
But I need to display this in real time, IE, will present the requested time in real time and also as soon as someone queue or exit will also happen in real time
I need a way to give a refresh on the jframe that will perform this display automatically, whether every 2 seconds, or 3... anyway
I need to accomplish this in JAVA
Does anyone know any way I can program this refresh or any way to do it automatically?
What have you done? Add the code to the question. It’s very likely that what you need is an Observer.
– user28595
Good morning, I will start the project in the afternoon, but I do not know how to develop this part of refresh, I thought to use the java timer.
– Vinicius Leonardo
It’s important that you start first, because then we’ll have a point where we can help you. Explaining this would make the answer too broad.
– user28595
I thought about doing something like this Timer timer = new Timer(0, new Actionlistener() { @Override public void actionPerformed(Actionevent e) { updateRecords(); } }); timer.setDelay()3000; // timer.start();
– Vinicius Leonardo
Which I didn’t even tell you, the answer would still be wide, because you have nowhere to go. I believe there are several ways to do this, but if you have already added something you have tried to do, then it is easier to answer.
– user28595