2,777 Posted Topics

Member Avatar for moman1981

A way: First you need a JFrame to present a window. A JPanel to draw the board on. Override the paintComponent class and do the drawing there A JPanel to display status such as whose move and winner or draw notifications. A switch for player to ask to play as …

Member Avatar for NormR1
0
362
Member Avatar for mahdi68
Member Avatar for NormR1
0
87
Member Avatar for ttboy04

To help figure this out, you could have added some println() statements to show how the values of your variables change: [CODE]or (int x = 1; x<=3; x+=1) { tempStringB = tempStringB + x + " "; System.out.println("tempB=" + tempStringB); // show new B } for(int i = 0; i …

Member Avatar for ttboy04
0
107
Member Avatar for BuhRock
Member Avatar for NormR1
0
765
Member Avatar for spartanace

[QUOTE]i want it to draw, increment draw increment [/QUOTE] It looks like the loop in the paintComponent() does what you want. It does a page.fillRect() and then increments start and then does a page.fillRect() and then increments for values.length times. What do you want to change?

Member Avatar for NormR1
0
608
Member Avatar for Alex_

Your posted code is missing the import statements needed to compile it. If there are any packages outside of the standard java packages, they'd be needed also.

Member Avatar for Alex_
0
328
Member Avatar for ceyesuma

Doesn't look like a java programming question. Have you tried asking it on a forum for the appropriate topic.

Member Avatar for ceyesuma
0
92
Member Avatar for leiger
Member Avatar for adaku

There are several classes for dealing with dates. Date and Calendar for example. If the times are as simple as your example, then take the minutes divide by 60 and add to the hours.

Member Avatar for JamesCherrill
0
87
Member Avatar for white feather

[QUOTE]java.io.FileNotFoundException[/QUOTE] I think is says that The program can't find the file/path to the file. Add a println() to show the value of location before the Constructor call to File().

Member Avatar for white feather
0
5K
Member Avatar for mitch9654

Can you post the code? There are two modes of writing to a file: replace or append to it.

Member Avatar for mitch9654
0
146
Member Avatar for neti1987

I copied your code, compiled and executed it without problems on a WinXP system with java 1.6.0-10

Member Avatar for neti1987
0
284
Member Avatar for ceyesuma

I found some code via Google years ago. It has lots of special code depending on what OS your executing on. I have no idea if the code will work on Linux or Mac today. I am currently using it in my WinXP apps.

Member Avatar for NormR1
0
330
Member Avatar for leiger
Member Avatar for Gribouillis
0
648
Member Avatar for nagyonbalogh

Can you post the full text of the error message? And the lines in your program referred to in the error message.

Member Avatar for mitch9654
0
386
Member Avatar for pi_lord12

Please post full text of error message here. It makes it a lot faster and can have more and correct info about the problem. Read the API doc for the method you are using. What does it return?

Member Avatar for pi_lord12
0
175
Member Avatar for evak77

Does your IDE have a Search? Try looking for where there is definition of a JFrame. Does the main class extend JFrame?

Member Avatar for quuba
0
104
Member Avatar for denmiller3
Member Avatar for Apollo12

You can't reference a non static class variable from a static method. The class varible only exists in created objects (ie with new). Why does the code want to see a variable belonging to an object when there is no object? If the variable is static then there is only …

Member Avatar for sunny101
0
329
Member Avatar for mitch9654

It's not an error. Its a warning to the user that the code being executed could be dangerous. Why do you need to sign the applet? What does it do that requires permission? Just tried your applet and got following error message in Java console: java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0) …

Member Avatar for mitch9654
0
569
Member Avatar for monmonsnow

You've got a long way to go. Write code to read in and save the dictionary file which I assume is given for you to be able to check there is such a word. Define and code a Player class. Then for each item in the list, think what the …

Member Avatar for NormR1
0
261
Member Avatar for bd338

Your code does not compile without errors. StackOverflow_Main.java(34,31) : error J0049: Undefined name 'JComponent' StackOverflow_Main.java(44,23) : error J0049: Undefined name 'Graphics' 2 error(s) Add some debugging code: put the code in the main() method in a try{...}catch(Error e) {e.printStackTrace(); ) block and examine the call stack trace.

Member Avatar for NormR1
0
202
Member Avatar for SoggyFries

What doesn't work about the code? What value does it return in error? I don't see any debug code to help you see how the algorithm is working. Try adding some println() to see what the code is doing.

Member Avatar for leiger
0
183
Member Avatar for runningkuma

Try debugging your code to see what it is doing and why. Add lots of println() statements to follow logic flow and see how variables change.

Member Avatar for NormR1
0
124
Member Avatar for daffydk13

Your comparing a double with an int. Not often equal. Write a small test program to see what happens when comparing double with int. Or add a println() of grade before testing if it == -1 Include the boolean expression: (grade == -1) in the println() to see if its …

Member Avatar for NormR1
0
174
Member Avatar for mohamed mo'men

If you are saving the values in an array, look in the array before adding a new one to be sure that it is not already there.

Member Avatar for NormR1
0
59
Member Avatar for Monkeyseraph

The End.