Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: cardlayout blues

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    26
    My Mood
    Nerdy
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default cardlayout blues

    im trying to find out how to pass

     INT ScoreQuiz=0;

    after button is pressed that the code for it is

    ScoreQuiz++; 
    ((CardLayout)(mainPanel.getLayout())).show(mainPanel, "card7");

    and have it display the added value in a text file that has the value set in it like this

    ("" +ScoreQuiz);

    and display it in the next jPanel.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: cardlayout blues

    What have you tried? Those few lines of code do not show enough to get an idea of what is right or wrong.

    What part are you stuck on? I do not understand what you are asking for help with.

  3. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    26
    My Mood
    Nerdy
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: cardlayout blues

    Quote Originally Posted by jps View Post
    What have you tried? Those few lines of code do not show enough to get an idea of what is right or wrong.

    What part are you stuck on? I do not understand what you are asking for help with.
    i have declared the value of 0 to ScoreQuiz
    now after the user hits the button it adds 1 to the value of ScoreQuiz, and moves to the next card in the set
    the next card has a label to display the value of ScoreQuiz, instead of showing nothing.

    http://imageshack.us/a/img109/5498/newbitmapimage3b.png

Similar Threads

  1. awt cardlayout help
    By op117 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 6th, 2012, 07:12 AM
  2. Problem with CardLayout
    By FireStorm in forum AWT / Java Swing
    Replies: 1
    Last Post: March 30th, 2012, 03:45 PM
  3. How to use CardLAyout without using applets???
    By divyarattan in forum AWT / Java Swing
    Replies: 4
    Last Post: August 9th, 2011, 11:19 AM
  4. Cardlayout Question
    By wagb278 in forum AWT / Java Swing
    Replies: 2
    Last Post: April 10th, 2011, 03:23 PM
  5. Cardlayout help
    By phantomswordsmen in forum AWT / Java Swing
    Replies: 1
    Last Post: December 22nd, 2010, 02:36 PM