Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By dlorde

Thread: Counter problem

  1. #1
    Razpet22 is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default Counter problem

    Hi!

    I'm making a short quiz for my school project and I stumbled upon a small problem. As I finished making questions and adding them into netbeans, I thought I should make a counter for the number of right answers. The number should be displayed on a special frame, possibly with jLabel object. I know this sounds like a noob question, but I'm almost new to netbeans.
    And yes, I can make a counter in regular Java programme:
    Java Code:
    int a = 0;
    
            if(jRadioButton19.isSelected())
            {
             a  = a+1;
            }
            else
            { }
            System.out.println("The number of correct answers is "+a);


    jRadioButton19 is the correct answer in this case.

    The thing is, I was always only used to System.out.print and that stuff, so I don't know much about the massive netbeans code. And also, you can't change like half of it. Can somebody help me out?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,963
    Rep Power
    8

    Default

    The best thing I can tell you to do is to ditch the GUI builder right now. It might seem like it's saving you some work, but in reality it's really hurting you.

    You also might want to check this out: How to Make Dialogs (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Razpet22 is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    I would love to ditch it and return back to eclipse, man, but the thing is, this application MUST be done in Netbeans. Oh the stress it's giving me!

  4. #4
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    7

    Default

    By all means use Netbeans, but just drop the GUI builder.
    KevinWorkman likes this.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default

    Unless it's the point of the course to learn the NetBeans GUI builder, in which case you should approach your instructor.

    db

  6. #6
    Razpet22 is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    Yes, sadly that's the point. It must be also created in GUI builder. There is only this small counter left to make, and it's too late to ask my instructor for help. He is my teacher and I need it done until friday. I sadly have no lessons until then. This is not the main point of my course, it's just a project for the end of a school year, and next year I will be happily programming in Eclipse again.

Similar Threads

  1. Writing a counter
    By Pojahn_M in forum New To Java
    Replies: 4
    Last Post: 05-03-2011, 03:56 PM
  2. switch (counter) example please
    By erin.ctm in forum New To Java
    Replies: 1
    Last Post: 12-03-2010, 11:21 PM
  3. Increment Counter for ID
    By blkshrk81 in forum New To Java
    Replies: 6
    Last Post: 12-01-2010, 01:25 AM
  4. Counter
    By ks1615 in forum New To Java
    Replies: 6
    Last Post: 02-20-2009, 03:02 AM
  5. Frequency Counter
    By justlearning in forum New To Java
    Replies: 0
    Last Post: 05-07-2008, 10:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •