2,777 Posted Topics
Re: Use images? Can you explain what you have now and how you want to change it? | |
Re: Can you edit your post and wrap the code in code tags? Use the [CODE} icon above the input box. The unformatted code is hard to read. Where do you print the lines you show? Where do you give values to the variables that are being printed as null and … | |
Re: Cross posted at: [url]http://www.javaprogrammingforums.com/whats-wrong-my-code/13796-bit-strings-java.html#post57004[/url] | |
Re: What do you mean by "bit"? In computer terminology a bit is 1/8 part of a byte. It is hard to add a bit to a String. You can only work with bytes (8 bits). | |
Re: Are there any error messages when you execute the jar file? To see the error messages, open a command prompt, change to the folder with the jar file and enter: java -jar <THEJARFILENAME>.jar Copy the contents of the command prompt window and paste here. If on Windows: To copy the … | |
Re: Use the javac command to create the .class files Use the jar command to create the jar file. | |
Re: Using extra threads without the extra cores will slow down the program. Searching an x by y rectangle for a match could take up to x*y gets to find it. | |
Re: [QUOTE]No method named "StringValue" was found in type "java.lang.String".[/QUOTE] The compiler can not find a method called StringValue for the String class. Where did you see that defined as a method? What is the type of the value you stored with the key of "type"? | |
Re: Comparing an double to a specific int value might be a problem. Why not just test if the value is less than 0. Try debugging the code by printing out the value that is read in to make sure the computer is getting what you expect for input. Can you … | |
Re: Take a piece of paper and write on it the input word and write underneath each letter of the word its position in the word, starting with 0 for the first letter. Then select the letters that are above the even numbers. | |
Re: Can you explain your problem? Does it compile? Does it execute? Do you get errors? Please post them here. Show what the program outputs and add comments to it to show what the output should be. | |
Re: [QUOTE]the two rectangles to move back and forth across frame horizontally[/QUOTE] To move horizontally you need to change the x values. Your code has the locations hardcoded. The variables created in a method disappear when the method exits. You should define the shapes outside of the paintComponent method where they … | |
Re: [QUOTE]there is a problem in computepath method[/QUOTE] Please explain. Show what the code is currently doing and explain what is wrong with that and show what it should be doing. | |
Re: Cross posted at [url]http://www.java-forums.org/new-java/54895-encryption-decryption.html[/url] | |
Re: Your code assumes that the second input is OK without testing it and looping back to get a valid input if it is not. Write a loop that When getting input from the user, stays in the loop until the user enters a good value. Can you copy the console … | |
Re: [QUOTE] I have an understanding, on paper, of how to write the program[/QUOTE] Can you post a simple list of the items you are having problems with? Then we'll work on them one by one. | |
Re: If you want to package other R/O files in your jar file you will have to use the getResource methods to read the file. You should be able to put any input file into your jar file. | |
Re: [QUOTE]memberList.parseStringToMember(inputInfo); <--error here[/QUOTE] Please copy and paste here the full text of the error messages. | |
Re: [QUOTE]Exception in thread "main" java.lang.NullPointerException at java.io.Writer.write(Writer.java:140) at nfa2dfa.NfaToDfa.OutputFile(NfaToDfa.java:217) [/QUOTE] Look at line 217 where you call the write method and check the values of the variables | |
Re: Change "void" to the datatype being returned. | |
Re: Have your code check the length of the username before submitting it. Refuse to except an invalid one. | |
Re: What package(s) are the classes you are using in? Do you have some API doc for the classes in that package? | |
Re: [QUOTE] it is aware that there is an error[/QUOTE] What is the "it" that is aware? What error is there? [QUOTE]it CONTINUES to write to the file regardless.[/QUOTE] Is the writing to the file controlled by the value of a variable? Where is the variable given a value? Is the … | |
Re: You could use an if to detect the number, the question is where would you save the count. It depends on the range of numbers. If a small range you could use an array. | |
Re: [QUOTE]it has to show character c[/QUOTE] To see the binary value of a char you can do this: [CODE]System.out.println("c=" + Integer.toBinaryString('c') + " " + (int)'c'); // c=1100011 99[/CODE] | |
Re: That's an interesting usage of the count variable as an index. What value do you expect it to have on line 26? | |
Re: Do you have any specific problems or questions? | |
Re: What is the navigator program you are using? Do you understand the difference between the http:// protocol and C:/ ? The first requires a server. | |
Re: Remove the container's layout manager and use the setBounds method for example | |
Re: Where is TimerListener defined? Why doesn't the compiler see it? Are the packages hiding it? | |
Re: Look at using the NOT (!) operator. | |
Re: Cross posted at [url]http://www.javaprogrammingforums.com/whats-wrong-my-code/13630-backtracking-maze.html[/url] | |
Re: [QUOTE]how to tell java that when it reads the empty line, that's the end of the record.[/QUOTE] Can you explain your problem here? When the code reads an empty line, the code knows that it is at the end of the record and goes to do what ever needs to … | |
Re: [QUOTE]after calling the method the user has selected, I want them to be able to select another[/QUOTE] Wrap the code in a while or do while loop that requires input from the user to exit. | |
Re: [QUOTE]how to actually display it within my JTextField[/QUOTE] Can you explain how you want the data to be displayed? Show what the program currently does and explain what you want to change. | |
Re: [QUOTE] help me to clear the error?[/QUOTE] You forgot to post the error. Please copy and paste here the full text of the error message. | |
Re: Is this the same problem as this: [url]http://www.daniweb.com/software-development/java/threads/408144/1742169#post1742169[/url] | |
Re: [QUOTE]what is the public VOID init used for[/QUOTE] You need to read about how applets work. Here's a link to the middle of the tutorial on applets: [url]http://docs.oracle.com/javase/tutorial/deployment/applet/appletMethods.html[/url] | |
Re: [QUOTE]How can i make the client side of the application search the network for the server socket? [/QUOTE] Is that like trying to find someone's telephone number? You have to know it if you are going to call it. | |
Re: [QUOTE] prompting the user to enter an integer[/QUOTE] Look at the Scanner class for an easy way to read input from a user via the console. Basically you print out a request, read in the user's response, check that it is a valid number and then test if it's prime. | |
Re: If you use the print() method without a newline character ('\n') the output will go on the same line. If you want future output to go on the next line use either the println() method or add a newline character: '\n' where you want the end of the current line … | |
Re: [QUOTE]I want to change the program and output should be like this:[/QUOTE] What does the current output look like? What is the difference between what the program does now and what you want it to look like? Please be very specific in describing the differences. | |
Re: Cross posted at [url]http://www.javaprogrammingforums.com/whats-wrong-my-code/13567-problem-maze-program.html[/url] | |
Re: Have you read the API doc for the ArrayList class? Do any of its methods look like they would "insert" an element into the list? Have you tried any of the methods to see what they do? Try writing a small, simple program that creates an ArrayList and add elements … | |
Re: [QUOTE]i need to use the keyboard or the mouse to click on the number printed on the moving[/QUOTE] Please explain what you are supposed to do. | |
Re: [QUOTE]what the actionPerformed should pass to the while [/QUOTE] Can you write a list of the steps the program should take to do what you want? The normal GUI program shows the user a form and waits for the user's input. When the user clicks on a button the action … | |
Re: For debugging your code I'd recommend you add printlns to show the values of variables as they change and to show the execution flow. The print out should help you understand what the problem is. You forgot to show what the correct output should be. | |
Re: You could use the Graphics class's drawLine method to make a grid. You show a component like a JButton by adding it to a container that is in a GUI that is visible. This would create a run method: public void run() { } |
The End.