2,777 Posted Topics
Re: [QUOTE] i am still getting an error[/QUOTE] Please post the full text of the error message or explain what the problem is. ![]() | |
Re: Think about how the first program controls how many * it prints on a line. It starts at one and moves on to a max number. Now rework the logic so it starts at the max number and works done to one. | |
Re: Can you post the full text of the error message? The message should show what line in the source is the problem. | |
Re: Read the tutorial and API doc about how focus works: [url]http://download.oracle.com/javase/tutorial/uiswing/misc/focus.html[/url] | |
Re: [QUOTE]cannot find symbol[/QUOTE] The compiler can not find the definition for the variable shown in the error message. You need to look at each error message, get the symbol that was not found, go into your code and find where it is defined. If it is not defined, you need … | |
Re: Can you explain what "jframe in a slow motion" means? Does the frame move slowly across the console? Do the pixels of the frame come slowly into view? | |
Re: Can you explain what your problem is? Does the posted code work as you want it to? Do you get errors? If so, please post the full text of the error message. | |
Re: [QUOTE] i can't seem to figure out where to add the description of the car [/QUOTE] Is this a GUI design problem? Does the file you posted have a description? What is the layout for the data in the file? 2 numbers on one line and text on the next. … | |
Re: [QUOTE]I'm looking for a way to browse and select a folder,[/QUOTE] An applet with permissions could do that if you want to do it from a browser. What code would the applet talk to on the server that would be able receive a folder of files? | |
Re: [QUOTE]I am having trouble getting it to work.[/QUOTE] Please explain the problem you are having. Another (and better) approach would be to use an ArrayList to hold the lines from the file. | |
Re: Please edit your post, select the code and wrap it in code tags. Use the [CODE] icon above the input box. You forgot to post the full text of the error message so we could see where it occurred and what the value of the index was. | |
Re: [QUOTE]all of these are giving errors and i'm not able to findout probelm.[/QUOTE] You need to post the full text of the error messages. Without them it is hard to tell you what the problem is. | |
Re: You could add tests for those variables' values to the if() statement ending condition. ![]() | |
Re: println is a method. '\n' is a character. | |
Re: Where are the images you are trying to load? Are they in the same folder as the class file or in some other folder on your PC. Applets are NOT allowed to go to any folders on your PC. They can read files from the folder that they are loaded … | |
Re: [QUOTE],how to differentiate ,from which TextField the Event is come from[/QUOTE] Look at the contents of the ActionEvent object that is passed to the listener. It has a reference to the object that is sending the event to the listener. | |
Re: [QUOTE]how can i print only the lines which are between spcific dates by using the above printed date format in JAVA.[/QUOTE] You need to write code that will find the lines with the specific dates. Start printing after finding the first date and stop when finding the last. | |
Re: String aLine = scannner.nextLine(); // read the next line (test with hasNext() first?) char aChar = aLine.charAt(0); // get the first character | |
Re: [QUOTE]how can I move the Graphics class object [/QUOTE] Not sure what this means. The JVM creates a Graphics class object and passes it as a parameter to the paint or paintComponent class. That is where you do your drawing using that object. You can call other methods from the … | |
Re: [QUOTE]My program no longer compiles.[/QUOTE] please post the full text of the error messages. Since you are using third party classes, you have provide more information. | |
Re: Please start a new thread for your problem. This thread is almost one year old. Be sure to ask specific questions about your problem with your assignment. | |
Re: [QUOTE] making this loop as long as you say yes [/QUOTE] Where is the code for the loop? All I see are some if statements? | |
Re: [QUOTE]I open the command window and typed javac Quiz1.java. When I do this it says javac:file not found:Quiz1.java[/QUOTE] Where is the Quiz1.java file? Is it in the 'current directory'? Use the dir command to see what is in the current directory and use the cd command to change directory to … | |
Re: Do you have the algorithm so you can design the code? Is the program going to have a GUI or will its interface be via the commandline or console? Do you have any specific questions? | |
Re: [CODE]"o "[/CODE] You should use a final String for defining the contents of a square. final String OMan = "o "; [CODE]else if(board[a+1][b+1].equals("o ")&&board[a][b].equals("* ")&&board[c][d].equals(" ")){[/CODE] vs [CODE]else if(board[a+1][b+1].equals(OMan)&&board[a][b].equals(SMan)&&board[c][d].equals(MTSqr)){[/CODE] Using so many hardcoded literals is a bad idea. If you mistype one the compiler will not tell you it is … | |
Re: Are you fighting with the layout manager? Who decides where a component is placed? I don't know if you can split the job of doing layouts. | |
Re: [QUOTE]The method [COLOR="Red"]add[/COLOR](Component) in the type Container is not applicable for the arguments (String) at HwkAssignment2Appl.<init>(HwkAssignment2Appl.java:[COLOR="red"]62[/COLOR])[/QUOTE] At line 62 in your code, you call the add method with an incorrect argument. | |
Re: Please post your code in the thread so all can view easily. Can you explain what your specific problems are? | |
Re: [QUOTE]java.lang.ArrayIndexOutOfBoundsException: -1 at farmersmarket5.Produce.addProduce(Produce.java:194)[/QUOTE] Look at line 194 in the Produce program. You have used an index with a value of -1 which is not a valid value for an index. You need to test the index's value before using it to make sure it is valid. | |
Re: For a simple gui: a text field for input, a textarea for output and a button. User enters text, presses button, output displayed in text area. | |
Re: [QUOTE]The errors I notice in the test packages are: [/QUOTE] Can you explain what the errors are? What happens when you compile and execute the code? | |
Re: Time to do some reading: [url]http://download.oracle.com/javase/tutorial/java/javaOO/methods.html[/url] | |
![]() | Re: Or see the String class's format() method. |
Is there an easy to use tool that OPs could use to find variable's whose class level definitions are Shadowed by local definitions of variables with the same name. I see that problem a couple of times a week. Do the standard IDEs have options that would warn about the … | |
Re: For debugging I'd start with an ordinary screen vs the FULL screen. Add some printlns so you can see where the execution flow goes and what the values of variables are as they are changed. | |
Re: Are you asking whether your code follows your algorithm correctly? Or are you asking if your algorithm is correct? For the first question, post your algorithm so we can check your code against it. For the second, ask Google. | |
Re: Read the API doc for the Scanner class. I assume that the keyboard variable is an instance of the Scanner class. Otherwise read the API doc for that class. [QUOTE] they don't seem to be working.[/QUOTE] Please explain. | |
Re: Does the component with the listener have the focus? Can it get the focus? Have you clicked on the component to give it the focus before pressing any keys? Please post the code here where we can see it and not have to download it. | |
Re: There are no direct connections to memory usage in java. The JVM takes care of it. [QUOTE]How i can allocate array of classes DigitData[/QUOTE] Define the array and then in a loop, fill the array with instances of the class. | |
Re: Have you worked out where the elements of the arraylist (single dim) are to go in the two dim array? For example, arraylist index on left, board indexes on right: 0 -> 0,0 1 -> 0,1 etc for all the elements in the arraylist. When you write out enough of … | |
Re: [QUOTE] The code compiles, but errors out when the Enter button is pushed[/QUOTE] Please copy and paste here the full text of the error message. That will tell us what is wrong. | |
Re: On most Windows systems there is a blank between Program and Files. Check your settings. | |
Re: Cross posted at [url]http://www.java-forums.org/awt-swing/49131-java-lang-arrayindexoutofboundsexception.html[/url] | |
Re: [QUOTE]it suddenly stops at line 72-73[/QUOTE] What does "suddenly stops" means? Does the loop there never end? If so, why isn't the variable being changed that allows the code out of the loop? Add some debug printlns where the variable is supposed to be changed to determine why its value … | |
Re: BufferedImage class for methods that would allow you to get sub-images. | |
Re: First you need to find the algorithm to do the calculations. When you get that, you can start working on the code for the program. If you have problems getting your code to work, post the code with your questions and any error messages you get. | |
Re: Are you sure the image file is being found? The code works for me. BTW use the paintComponent method in Swing components vs paint | |
Re: Please edit your post, select the code and press the [CODE] icon above the input box to wrap code tags around your code. Unformatted code is hard to read. It looks like the writeLetter method calls itself? Is that right? That is recursion and you probably do NOT want to … | |
![]() | Re: What are your questions about your assignment? You mention the names of several methods but do not say if you are to write them or if they are provided to you and you are to use them. Please explain. ![]() |
The End.