2,777 Posted Topics
Re: Can you post a complete program that compiles and executes that demonstrates the problem? It would be useful if you included your comments in the code describing your problem instead of having the comments in one place and the code in another. | |
Re: Can you show what the program does now and explain what the problem is? How would you do it if you did it manually? Would you subtract the amount for the quarters when looking for the dimes? | |
Re: Is the console variable null? Read the API doc for the System console() method. Can that method return null? I don't know why your IDE doesn't support the console method. | |
Re: There is a java class named Timer. Check that out. ![]() | |
Re: [QUOTE] it's on line 12 (if (one == 1){) [/QUOTE] What is the "it's"? Do you get an error message? Please copy and paste the full text of the error message here. The equality test: one == 1 doesn't make sense. The variable 'one' can't be compared to an int … | |
Re: [QUOTE]I want the loops to stop executing as soon as the function is called recursively.[/QUOTE] Try breaking out of the loops immediately after the recursive call is made. | |
Re: [QUOTE]i want value assign to form1 in the start method to call in main not calling the ful method[/QUOTE] Sorry, I'm not able to understand what you want. Can you explain it further please? Do you want the start() method to return the value of form1 to its caller? ![]() | |
Re: If you try to compile your code you will get a list of error messages that you should post here. The messages contain information that explains what and where the error is. Please copy and paste here the full text of your error messages. | |
Re: Can you post all of the code before line 44 back to the start of the method the line 44 is in? Is the variable i defined? | |
Re: Please use the correct code taga for you code. See the icon above text field to right. What are your questions or problems? If there are errors, please copy and paste here the full text of the error messages. | |
Re: Please copy and paste here the full text of the error messages so we can see exactly what the error is. If you are on Windows: To copy the contents of the command prompt window: Click on Icon in upper left corner Select Edit Select 'Select All' - The selection … | |
Re: Please use code tags when entering your code. Use the icon above to right. [QUOTE]what I'm doing wrong[/QUOTE] If there are errors, please copy the full text and paste it here. Is the program generating the correct output? Your posted output has no comments showing if or where there is … | |
Re: What language are you programming in? This is a forum for the java programming language. | |
Re: [QUOTE]how do i import pieces [?][?] array in class chessInterface to a pieces class (Bishop in this example..)[/QUOTE] Pass a reference to the array to a method: Bishop bshp = ... bshp.checkMove(pieces); What is in the pieces array? Its dim is 7x7 pieces=new ChessPiece[7][7] but you access the 8th position: … | |
Re: [QUOTE] shos error tha it cnnot find symbol[/QUOTE] Please copy and paste full text of the error message here. What is the classpath set to when you compile the program? It must point to the folder containing the package folder. | |
Re: [QUOTE]my code doesn't work correctly:[/QUOTE] Can you describe what isn't correct about what you've posted? To debug your code add a [CODE]System.out.println("e=" + e); // Show event contents[/CODE] to the listeners and click/double-click the component and look at what is printed out. | |
Re: How long does it take if you manually ping an address? The timeout is (1+3) seconds, so (255*4)/60 = 16+ minutes Add some debugging code to printout the System currentTimeMillis to see how long each "ping" takes. | |
Re: [QUOTE]What am i doing wrong ??[/QUOTE] If there are errors, please copy the full text and paste them here. | |
Re: Test that the length of the args that it has enough elements before trying to use any of its elements. | |
Re: [QUOTE] I can't seem to get the output[/QUOTE] Can you explain what happens? Try printing out the values of coordinates1[a].length and coordinates1[b].length to see what is happening in the code. | |
Re: [CODE] int g3 = g1 + g2;[/CODE] What is this statement supposed to do? What are the values of g1 and g2? ![]() | |
Re: Comment on your board size: pieces =new ChessPiece[7][7]; Most boards I've played on have 8 rows and 8 columns. if(x==chessPiece) { The == operator checks if the two references point to the same object. It does NOT look at the contents of the objects. To do that you must use … | |
Re: Or you could use the clone() method to make a copy of an object. | |
Re: To keep your two dimensional indexing scheme You could have an arraylist that contains arraylists. Dimension one would be into the outer arraylist. A get() there would return the inner arraylist. Dimension two would be into that arraylist. | |
Re: Do you have the layout of a movie file and know where in the file the data you want is located? Given that we can help you read the file and extract the data. | |
Re: [QUOTE]Some parts of application do not work[/QUOTE] Are there any error messages displayed on the console? Open a command prompt, change to the folder with the jar file and enter; java -jar YOUJARFILENAME.jar If there are error messages you don't understand, copy and paste them here. | |
Re: How can we help you write your program without any code from you or questions from you about the program you are trying to write? | |
Re: Do all the catch blocks do prints of some kind? Do you run the server with a console window that will be open when the server stops that could show any error messages? | |
Re: Please explain what your problem is. Copy and paste the full text of the error messages here. | |
Re: [QUOTE]faced with a nullpointerexception,[/QUOTE] please copy and paste here the full text of the error message. It has useful info to solve your problem. | |
Re: [QUOTE]my codes can only read one file instead of all files in my directory.[/QUOTE] Try debugging your code by printing out a list of all the files found in the directory: System.out.println("All files=" + Arrays.toString(fileDir)); // show all files found and then show each one as it is being processed: … | |
Re: This is a java forum, not javascript or php. Try one of those. | |
Re: An approach: Create a two dim array of String with the first array defined by the size of the Arraylist. Iterate thru the array list and set each second dim of the String array to next element of the ArrayList | |
Re: The return statement only returns the value of one variable. The prototype for a method only specifies one type to be returned by the method. Hence there is no way to return the values of more than one variable in one statement. You either need to redesign the logic of … | |
Re: Don't put any of your code in the JDK's bin folder. | |
Re: Another definition; Swing is a set of classes for building GUI. Swing GUI classes can be used in applets or applications. JApplet is the Swing version of the Applet class. Applet is special class that browsers can work with to have a GUI on a web page. The GUI can … | |
Re: What part of the project do you want to code? The part that actually makes the sound is mostly contained in packages and classes. The GUI to control what is played would be as a Swing application. I downloaded a sample sound Development Kit years ago, but can't find it … | |
Re: Why ask a question about problems in another language/environment on a java forum? | |
Re: [QUOTE]how to make a menu into this program switch style[/QUOTE] Not sure what you are asking as the solution is so simple: Use println() for each line that you want printed: System.out.println("MENU"); System.out.println("[1]=ACCEPT;"); etc for the rest of the list | |
Re: What is the error message in the browser's java console? If you have any questions about it, please copy and paste the full text here. | |
Re: I start by making a small program that only reads the data into an array and then prints out the contents of the array. For printing the array see the Arrays.toString() method. The Scanner class can be easy to use to read in lines of data. Then use the String … | |
Re: [QUOTE]how to appoint to my spaceship speed, direction etc. I mean before i click launch button,[/QUOTE] I assume those properties values are held in variables. Can you 'appoint'/set their values in the constructor for the spaceship object? Your scattered comments and pieces of code are hard to follow. This seems … | |
Re: [QUOTE] it didn't work. Any suggestions?[/QUOTE] Copy and paste here the full text of any error messages you get. If no errors, describe what the program does and why that is NOT WORKING. [QUOTE]What is the method of Graphics that allow you to draw within the program? [/QUOTE] There are … | |
Re: Where do the programs TestWEImplServer & TestWEImplClient come from? | |
Re: 2). Skip might work IF all the records are [B]exactly the same length[/B]. Try it and see what happens. | |
Re: To debug your code add a println() to show the value before you try to parse it. println("pin=" + pin + "<") // show pin's value [QUOTE]a number format error[/QUOTE] Can you post the full text of the error message here? | |
Re: Can you show the output you now have, describe what is wrong with it and show what you'd like it to be? ![]() | |
Re: You could search all the drives. Use the File class's listRoots() method to get a list of root Files. In a more structured environment, you could use environment variables to point the external drives or memory sticks. Set them on the new computer and your code can find the stuff … | |
Re: [QUOTE] will the 2 and true overwrite the 2 and false or they both exist in the Hashtable? thanks[/QUOTE] Can you write a simple program to test what happens? Then you'll know if and how it works. Let us know what happens. |
The End.