can any one please help me out.
I am working on a JSE Quiz application.
A question pops out at a time along side four options.
The player is expected to choose the correct answer.
This is where I need help:
1. I need the option field to change color on mouse point
2. I also need the option field to be sensitive to mouse click(clickable)
3. Finally after it is clicked, the program should verify
the answer and output success or failure message accordingly
2 or 3 areas, maybe JPanels in a JFrame, but there are options.
panelOne will have the questions built from an array of questions
panelTwo will have the 4 possible answers as JCheckBoxes, also built from an array of answers that correspond to the questions
panelThree can have JButtons like "Submit," "Cancel," "Quit," whatever your program needs.
The JButtons and JCheckBoxes will have listeners so the program knows when a choice has been made. Based on your explanation, maybe you don't need JButtons at all, and the user's first JCheckBox choice will count as the answer - a little cruel to not allow the user to change his/her mind, but maybe that's the assignment.
Do some coding and come back for help. The color changing can be added later, so don't sweat that now.
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Thanks for the reply,at the situation where
i can avoid the use of Jbotton or check box but instead
use JText field. Now the Jtex field will be sensitive to
mouse point. Once it is clicked something should happen.
A typical example is the "Who want to be a millionar game"
Atakpa Daniel wrote:at the situation where i can avoid the use of Jbotton or check box but instead use JText field. Now the Jtex field will be sensitive to mouse point. Once it is clicked something should happen.
I think of a JTextField as a component that allows the user to enter or change text, and this is not what I believe you want. If I understand you correctly, you want to display rows of text that the user won't change but will select on mouse click. If correct, possible solutions include use of a JList that you've added an ItemSelectionListener to, or if you want to fully roll your own, then a grid of JLabels held in a JPanel where the JLabels have a MouseListener added to them.
I think she's lovely. It's this tiny ad that called her crazy: