3 Replies - 4241 Views - Last Post: 05 June 2010 - 11:55 AM Rate Topic: -----

#1 Guest_joedbug*


Reputation:

writing java quiz application

Posted 04 June 2010 - 10:24 AM

i am writing a quiz application using java, my problem is how am going to get the question on the panel to change when the next button is click? am not good in java but i get to do it for my little brother learning stuff
Is This A Good Question/Topic? 0

Replies To: writing java quiz application

#2 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2657
  • View blog
  • Posts: 11,207
  • Joined: 20-September 08

Re: writing java quiz application

Posted 04 June 2010 - 10:37 AM

Try using a CardLayout (see Sun tutorial)
Was This Post Helpful? 0
  • +
  • -

#3 zim1985  Icon User is offline

  • Grand Inquisitor
  • member icon

Reputation: 74
  • View blog
  • Posts: 568
  • Joined: 19-February 10

Re: writing java quiz application

Posted 04 June 2010 - 11:39 PM

View Postjoedbug, on 04 June 2010 - 08:24 AM, said:

i am writing a quiz application using java, my problem is how am going to get the question on the panel to change when the next button is click? am not good in java but i get to do it for my little brother learning stuff


Assuming you are doing a GUI, you would have to repaint the component you are painting on with the new options and such. Change the strings and whatnot. I would do it more as an update kind of method.
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8325
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: writing java quiz application

Posted 05 June 2010 - 11:55 AM

Put your question in a JLabel
when you want to change it just use the setText("another question") method of the JLabel class to change the text it displays
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1