2,777 Posted Topics
Re: What packages are you using? I don't find the Pixel class in the Java Se API doc. Have you printed out the x,y locations of the source and target pixels to see if their values are correct? | |
Re: Please post the full text of the error messages you get. | |
Re: Can you make a small, simple, single program file that shows the problem you are working on? Or merge the six files into one file and post that. | |
Re: Also posted at http://forums.devshed.com/java-help-9/database-in-java-934288.html | |
Re: Please post the full text of the error message that shows where the error occurs. What statement causes the exception? > method whose result type is void? The posted method is defined with return type of void on line 1. It can not return a value on line 12. Change … | |
Re: Do you have any specific questions you'd like to ask about your assignment? | |
Re: Please only start one thread per topic. | |
| |
Re: > how to compare these 2 Term objects Would the two terms be equal if their coef and expo values were equal? The equals() method would need to cast its arg to a Term object and access its contents. | |
Re: > java.lang.OutOfMemoryError: Java heap space That's usually caused by recursive calls. Check you code to make sure there is no recursion. How many lines does it read from the input file before the error happens? You need to post the input file to allow us to test the code. | |
Re: > ArrayIndexOutOfBoundsException: 6 > at programfour.ArrayReader.main(ArrayReader.java:28) The index used on line 28 is past the end of the array. What are the dimensions of the array? Which index is past the end? Remember that the max value for an index is the array length-1. An array defined with 5 elements … | |
Re: Where in the posted code is the problem? I can not find: tutormin in the posted code. | |
Re: > java.lang.NumberFormatException: For input string: "Poland" You should post the full text of the error message which gives the name of the method that threw the error and the location in the program where the error happened. I guess that the program had a String containing: Poland that it tried … | |
Re: > swing class to take user input? If from the console window, the Scanner class is easy to use. If from a dialog window, a JOptionPane could be used. If from an input field in a JFrame, a text field could be used. | |
Re: Please post the full text of the error message. An array element reference requires an index. | |
Re: To run an applet you need an html file with an <APPLET tag. Load the html file into a brower or the applet viewer to execute the applet. The browser will call the applet's methods to execute it. See the tutorial for all the details: http://docs.oracle.com/javase/tutorial/deployment/applet/index.html | |
Re: > Exception in thread "main" java.lang.NullPointerException > at hutchisonbarry.Group.getAllContaining(Group.java:50) > at hutchisonbarry.HutchisonBarry.main(HutchisonBarry.java:88) There is a variable on line 50 that has a null value when the code is executed. Look at line 50, find the variable with the null value and backtrack in the code to see why that variable … | |
Re: Start by making a list of the features the program should have. For example: what input does it get and what does it do with that input. | |
Re: If the number of minutes is less then 10 then you need to concatenate a leading "0" to the minutes to get the two digits. | |
Re: How are you trying to execute the code? Are there any error messages in the browser's java console window? | |
Re: Try debugging the code by adding some println statements to show where the execution flow goes and to show the values of the variables as they are changed and used. | |
Re: Convert the code to use a JPanel for showing components and add it to a JFrame. Rewrite the applet methods like init() and start() or call them from the class's constructor. Replace all applet methods. What happens if you change the extends to a JPanel and execute the code as … | |
Re: This thread is OLD. Please start a new thread with your problem. Be sure to post the full text of the error message and the code that caused it. | |
Re: > check wether the values displayed in the label is 0 or not What is the value returned by the getText() method? Print it out so you can see if it is "0". | |
Re: > compile the class but it comes up with an error Message saying "Could not find the main class: zellers.algorithm.Main. Program will exit." That sounds like an execution time error, not an error from the javac compiler program. Do you understand packages and how putting a class in a package … | |
Re: Make sure the variables are defined in the same scope (within the same pair of {}s) as where you are trying to use them. They need to be defined at the class level if you are going to reference them in different methods. | |
Re: Can you explain what your problem is and ask some specific questions about it? Can you add some comments to the posted code that describe the steps that they are taking to solve the problem. For example what is the for loop at line 5 supposed to do? | |
Re: Can you post what the agentreport.txt file should contain? Here's what I get: > > > COMMERICAL > FARM > LAND > RESIDENTIAL > > 101 600000.00 > 105 30000.00 > 106 200000.00 > 107 1040000.00 > 110 250000.00 Add some debug println statements in the pTypes method to show … | |
Re: > array should be inside of class or inside of the void setString method. If you want the contents of the array to be avaiable after execution leaves the method, you should define the array at the class level. If the array is discarded when the method exits, it can … | |
Re: Can you add the needed import statements so the code will compile and also post the html needed to execute the applet so the code can be compiled and tested? | |
| |
Re: Is the keyPressed() method ever called? > unable to register the right key event from this program Can you explain what "to register" means? What do you want the code to do? What does the code do now? | |
Re: What do the if statements do incorrectly? What happens when the code executes? Can you show the output and explain what is wrong with it? Can you explain how the program is supposed to work? What does the program do, what does the user do and what does the program … | |
Re: I prefer the second method because when I use the editor's "Find matching brace" function from a } it displays the line with the statement I'm looking for. With the { on an empty line I have to scroll up one to see where I am in the code. That's … | |
Re: What happens when you compile and execute the code? There are several extra spaces in the posted code. Is what you posted copied from your code or did you type the post in from memory? | |
Re: How can the code be executed for testing? What does it print out now? | |
Re: Does the code read in the numbers OK? Print them out to see what is being read in. Have you tried to manually encode a single letter and decode it to verify that you understand the algorithm? | |
Re: Make sure the definition of the inFile variable is in scope where you are trying to use it. In scope means defined within the same pair of {}s where it is being referenced. | |
Re: Can you post the contents of the command prompt window when you execute the jar file? 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 will show Click in upper left again Select … | |
Re: What are the possible combination of values of the variables you are testing in the paint method? With the chained if/else if statements the first one that is true is the only one that will be executed. Is that what you intend? BTW `if(jump)` is sufficient. You don't need == … | |
Re: Java passes variables by value. You can not change the value of the original variable. Some objects like Strings are immutable and their contents can not be changed. The contents of objects like a List can be changed. | |
Re: Add a call to the printStackTrace() method to the catch block to get more information about where and what exception is being thrown. | |
Re: Can you post a small, complete program that compiles, executes and can be used for testing? | |
Re: Should the if on line 69 fall through to the next if on line 74? What if the condition on line 69 is false? | |
Re: A question: Why do you create an Orderbook object on line 17? If you don't assign what is returned by the new, the object will not be avaiable for use anywhere. There must already be an object existing for the addNewOrder()method to be called. | |
Re: Try debugging the code by print out the value of i every time it is changed as the loop executes. Also print out the value of c that goes with that i value. | |
Re: > how do I access the printElements method from main Since that method is static you can call it directly from the main() method without creating an instance of the class. | |
Re: > I keep getting an out of bounds error. Can you post the full text of the error message that shows where the error happens and what the value of the index is? | |
Re: What are the coordinates for the pixels (source and target) as they are copied? Make a loop that copies the pixels for each row inside another loop that goes through the rows. | |
Re: Can you post the console that shows the input to the program and what the program prints out? In windows To copy the contents of the command prompt window: Click on Icon in upper left corner Select Edit Select 'Select All' - The selection will show Click in upper left … |
The End.