2,777 Posted Topics
![]() | Re: The program should be event driven not spinning in a loop. The code waits for the user to do something (an event) and then reacts to that event. It is not executing in a loop while it is waiting. It has returned to the JVM and waits for the JVM … |
Re: You need to read the tutorial about how to write GUIs. [url]http://docs.oracle.com/javase/tutorial/uiswing/index.html[/url] | |
Re: Put the diagram in code tags and see it that preserves the formatting [CODE] ---------- | | | | ---------- [/CODE] [QUOTE] but what if it's both above, and to the side?[/QUOTE] Can you explain what you mean. | |
Re: Take a look at this: [url]http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html[/url] | |
Re: [QUOTE] missing return statement[/QUOTE] The compiler thinks there should be return statement where it shows this error. [QUOTE]unreported exception java.io.IOException; must be caught or declared to be thrown[/QUOTE] Enclose that statement in a try catch block. Be sure to add a call to the printStackTrace() method in that catch block. | |
Re: Try debugging your code by having it print out all of the variables values involved. The print outs will show you what the code is doing. | |
Re: Look at using a modal JDialog window instead of the second window. | |
Re: Please post the full text of the error message. | |
Re: See the posts on this thread: [url]http://www.java-forums.org/java-applets/56280-create-moving-points-respect-time.html[/url] | |
Re: I don't know if a regexp will do that. Perhaps someone that knows will come along and suggest a solution. You might be able to use the String class's indexOf and substring methods. | |
Re: Does an overload of createFont() method take a URL instead of a File? The classpath for code in a jar is the jarfile which is NOT useable in a File constructor. Add some debugging code to print out the values returned by the various method calls you are using. To … | |
Re: [QUOTE]holds an unknown number[/QUOTE] If you don't know the number of pairs and must use an array, then two passes might be needed. A better approach would be to use an ArrayList which will automatically resize if needed. | |
Re: Looks like the Nokia Suite changed the registry and didn't restore it to its old value when it was uninstalled. Reinstalling the JRE may restore the registry so the OS knows how to execute a jar file. | |
Re: [QUOTE]have the text clickable[/QUOTE] What does "clickable" mean? Do you want an event when the text is clicked on? Is the text part of an image, not a String you are adding to a component? Where and what is the text and what kind of component is the text in? | |
Re: Try a loop that looks at the contents of each of the arrays. That assumes that all the arrays are the same length. | |
Re: There are several ways to give applets permission: sign the jar file the class files are in add an entry to the .java.policy file on the PC where the applet is being executed See the tutorial for more info: [url]http://docs.oracle.com/javase/tutorial/deployment/applet/index.html[/url] | |
Re: [QUOTE] it is not doing what I want it to.[/QUOTE] Where does the code create the barcode String? Add some printlns to that code to print out the values of the variables as they are set and changed. The print out will show you what the code is doing. If … | |
Re: Check that you are not doing integer division. | |
Re: Where are the variables that are referenced in the error messages defined? The compiler can not find their definitions in the LineItem class. | |
Re: When posting code please put it in code tags to preserve the formatting. Use the (CODE) icon above the input box. Your unformatted code is harder to read and understand. ![]() | |
Re: > problem here is it will pass an empty field If the value is a String the String class has methods you can use to detect an empty String. Please post any code you have questions about here on the forum. Be sure to wrap the code in code tags. … | |
Re: [QUOTE]It throws StackOverFlow every time I complile project. [/QUOTE] Do you mean you get the error when you execute the program. Compiling it should not give a stack overflow. The program is probably in a recursive loop and not stopping until it runs out of memory. Add some println statements … | |
Re: I think Sockets is the main one. | |
Re: [QUOTE]method start() is undefined for the type roundabout02.carProcess[/QUOTE] The compiler can not find the method: start() in the class: carProcess. Where is that method defined? | |
Re: A return statement can return one item. That item could be an array with any number of elements. Think of what you can put on the right hand side of an assignment statement statement. | |
Re: Cross posted at [url]http://www.java-forums.org/advanced-java/56506-help-drawing-tex.html[/url] | |
Re: Have you read the API doc for the Graphics2D draw() method? Are you calling it with the correct arguments? Does the ArrayList class have a getX() method? If the ArrayList contains points, and two points define a line, would you want to get two points from the ArrayList and draw … | |
Re: The is the String returned by the default toString() method. If you want to see something from the Value class add an override to the toString() method to the class and return the string that you want to see. | |
Re: Add an else at the end of the if/else if chain and have it print out the contents of the event object. That handles the case where none of the above were true. You should always add an ending else to catch unexpected cases & problems. | |
Re: [QUOTE]getting the the user input for the loan terms and loan interest to work[/QUOTE] Can you explain what "to work" means? Can you explain what you are trying to do and what your problem is? | |
Re: [QUOTE] detect if the code contains the "null" part [/QUOTE] The String class has methods for comparing the contents of a String. The consoleWrite() method could use an if statement with a String method to see if its second argument is the String: "null" | |
Re: Please print out the contents of the array and explain what is wrong with its contents and show a sample of what it should look like. The Arrays class's toString() method is useful for formatting a single dim array for printing. | |
Re: The technique you are using looks like a recursive call. Eventually the program will run out of memory. Not likely when it requires user input for each loop. A way to avoid recursive calls would be to use a loop that uses the user's input to control it looping back … | |
Re: Where do you set the windows visible? Can you delay setting the menu window visible? | |
Re: [QUOTE]Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 16 at ArrayProcessing.countAndDisplay(ArrayProcessing.java:135)[/QUOTE] The code at line 135 uses as index value that is past the end of the array. Look at the code and see why the value of index gets past the end of the array. Add printlns to print out the index's … | |
Re: [QUOTE]will not display the cd information [/QUOTE] Can you give us a clue on how/where the data is to be displayed? Where does the info come from? Where is it to be displayed? I see some catch blocks that do NOT call the printStackTrace() method. You need to add calls … | |
Re: Can you copy and paste here the console? Instead of an image. 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 Edit and click 'Copy' Paste here. | |
Re: Never tried it. Write a small test program and see what happens. | |
Re: You don't ask a question or say what your problem is. Does your code work? If not explain what the problem is and give some examples where the code does not work. Add some println statements to print out the values of the variables that are being used. | |
![]() | Re: Try looking at the JPopupMenu class. There are links to the tutorial from its API doc that show how to use it. |
Re: Do you have a specific question or problem with your code? [QUOTE] I just want some IDEAS or maybe sniplets of code for my last method[/QUOTE] This is the last method: public static void printString What help do you need with that??? | |
Re: Have you tried writing some classes to test this? | |
Re: [QUOTE]I am having trouble with the main programming [/QUOTE] Please explain your problems. Copy any error messages and paste them here. If the program's output is not what you want, copy the output here and add comments describing what is wrong with it. | |
Re: How are you keeping the random number used on line 32 within the bounds of the array? In the RandomNumbr method you have a hardcoded: 50. Your code should use the size of the array, not a fixed number. | |
Re: Do you have any specific java programming questions? or problems? Post them. | |
Re: Can you edit your post and wrap the code in code tags? Use the [CODE] icon above the input box. Unformatted code is hard to read and understand. | |
The End.