Results 1 to 3 of 3
- 10-05-2010, 07:40 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
Need help with assignment! please
Hello,
I have an assignment where I had to create a simple 5 question math quiz. The quiz is to be displayed in a showInputDialog box.
I have completed all the code to do this and it seems to all work well.
However, after I am done I need to display the results (questions asked, questions correct, and percentage) of the quiz in an applet window using drawString.
Because my main code to perform the above functions is in a .java file I am unable to use drawString at the end of the file to display the results. Eclipse is telling me that drawString cannot be used in a static class. But when I try to add the new appropriate applet class into the file it does not recognize the variables from the static class.
I am newto JAVA and I am wondering if this is even possible?
Thanks for any help in advance.
- 10-05-2010, 09:32 PM #2
Normal way to use drawString is to extend the JPanel class, override its paintComponent method and call drawString from inside the method. Then you can add the class extending the JPanel to a container like a frame to display it.using drawString.
I don't know how an applet fits into this project. What do you mean by applet? Are you talking about the Applet class?
- 10-06-2010, 09:58 AM #3
Similar Threads
-
Need help with a assignment
By helpMe.Java in forum New To JavaReplies: 7Last Post: 06-06-2010, 04:49 PM -
Need with my assignment ...
By allergy01 in forum New To JavaReplies: 1Last Post: 04-25-2009, 08:33 AM -
Can somebody help me in my assignment
By coolstruxx in forum NetBeansReplies: 0Last Post: 03-24-2009, 01:27 AM -
First GUI Assignment
By ljk8950 in forum New To JavaReplies: 1Last Post: 07-31-2008, 07:29 AM -
for Assignment plz help
By assamhammad in forum New To JavaReplies: 1Last Post: 11-06-2007, 08:35 PM


LinkBack URL
About LinkBacks


Bookmarks