MAke a quiz in gui which shows the player the time left for a particular question and automatically proceeds to the next question when time limit exceeds. time left to be shown in a jlabel
AkshatGupta
0
Light Poster
Recommended Answers
Jump to PostPost some code showing what you've done and explaining what you need help with.
Your turn...
Jump to PostForget thread and sleep - it doesn't work well in a GUI
You need a Swing Timer that will update your GUI at regular intervals.
Here's a couple of tutorials:
https://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html
Jump to PostIts a mistake to try to learn basic principles from a sample as complicated as that.
Because the weather here is horrible and I have nothing better to de I'll take a moment to show you a very very simple program that updates a JLabel with a one-second counter.This …
Jump to PostStarting at the top...
You create a Timer by giving it a time interval (1000 mSec in this case) and an ActionListener (the same as an ActionListener for a JButton etc). The Timer then calls the ActionListener every 1000 mSec. The code above uses a Java 8 lambda, which maybe …
Jump to PostSounds like you are having layout manger problems, for example, the default LM for a JFrame is a BorderLayout, in which if you just add a component without saying where to add it it goes in the center position, replacing whatever was there before.
This tutorial will teach you how …
All 33 Replies
happygeek
2,411
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
AkshatGupta
0
Light Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
AkshatGupta
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
AkshatGupta
0
Light Poster
AkshatGupta
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.