Bar graph in Java for Mastermind

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Butterflybis
    New Member
    • Sep 2007
    • 1

    Bar graph in Java for Mastermind

    Hi all,

    I’m newbie in java code development, I have written a mastermind play, and I would like to include a time limitation (for example 3 minutes) which appears like a coloured and vertical column (bar graph?), and which decreases with time, displaying remaining time at the top of the column. When time has elapsed a window displays: “Game over! Do you want to play again “.

    Please help me, I should get a code in VisualJava, and in Java for graphical interface.

    kind regards,

    Elisabeth
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Originally posted by Butterflybis
    Hi all,

    I’m newbie in java code development, I have written a mastermind play, and I would like to include a time limitation (for example 3 minutes) which appears like a coloured and vertical column (bar graph?), and which decreases with time, displaying remaining time at the top of the column. When time has elapsed a window displays: “Game over! Do you want to play again “.

    Please help me, I should get a code in VisualJava, and in Java for graphical interface.

    kind regards,

    Elisabeth
    Hi Elisabeth! Welcome to TSDN!

    What you want is Multithreading: you need one Thread for the timer and another for the actual game. Work through a tutorial about Multithreading and try to use your new wisdom on your Project.

    Greetings,
    Nepomuk

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Have a look at the JProgressBar class API documentation.

      kind regards,

      Jos

      Comment

      Working...