• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Jframes and quiz game

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi
I want to create a quiz game where I have to ask questions and gives 4 options. The submit button to check the answer and Next button to move to next question and of course next frame.
My question is how should I design this game? Should I have one frame for each question and moves to other questions frames by frames? This seems very strange because if I have 100 questions then I will have 100 frames?
Please suggest some idea?
 
Marshal
Posts: 79979
397
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have arrived in the wrong location; this page is for discussing the website itself. I shall try moving you elsewhere.

What happen swhen you play the game from the command line? Don't even think of writing a GUI until you have it working without the GUI.
 
Sheriff
Posts: 28333
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As for design: no, you would just use a single JFrame containing suitable components to show your data, and change those components as needed.
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First I suggest you read the Swing or JavaFX tutorial. Next look up the LayoutManager interface and the CardLayout class in the java api.
 
Saloon Keeper
Posts: 15731
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think the CardLayout is appropriate in this case. CardLayouts are for different layouts in the same component. This is the same layout, but different data.
 
Nigel Browne
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:I don't think the CardLayout is appropriate in this case. CardLayouts are for different layouts in the same component. This is the same layout, but different data.



That depends on the questions on the the cards. Some might be multiple choice with only one correct answer using radio buttons, others maybe multiple choice with more than one answer that is correct using check boxes.

Layout tutorial
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic