2,777 Posted Topics
Re: What paths do you need to set? What version of Windows are you on? The main change is to add the path to the JDK's bin folder containing the javac commmand to the System's PATH variable. To see what you currently have, open a command prompt window and enter: PATH. … | |
Re: Did you read the API doc for the read method? What does it return? Is it a String or something else? What did you see in the JLabel? Try printing out the value of inFile as an int. Then print it casting it to a char and see what you … | |
![]() | Re: How is the browser asking for the image? Is because of an HTML tag like <IMG SRC= Does the browser do an HTTP GET to the server and the server calls your code to send the bytes? What format is the browser expecting the image bytes to be in? ![]() |
Re: Does the JPanel have the focus? Can it receive the focus? Not all components can get the focus. Some times you must "register" the component to receive focus. See the API doc for these two methods: requestFocus() and setFocusable() | |
Re: [QUOTE]with Java the [B]bison and flex[/B] is abit confusing because its in C[/QUOTE] Can you explain what you are referring to here? [QUOTE]using java to construct the compiler.[/QUOTE] Does this mean you are to write a compiler in java? With bytecode output that can be executed by the java command? | |
Re: I agree with both of the above. An IDE makes too many things appear to be magic. Best to do it manually a few times to see what is going on before going on to an IDE. | |
Re: Change your logic so you don't create a new JFrame in Drop's constructor. Or in the mousePressed method don't create a new Drop object. | |
Re: First you need to find the algorithm for the selection sort and distill it down to steps that can be programmed. What is the code you posted supposed to do? It needs a few comments to describe what each section is to do. | |
Re: [QUOTE] a way to find out how many array elements are initialized like this[/QUOTE] No easy way. You have to look at each element and see how it is set. Arrays are pretty dumb. If you use a collection class like an ArrayList, you can ask it how many items … | |
Re: Have you taken a piece of paper and pencil and worked out the details on how the pointers change when working with a LL? [QUOTE] insert 1, how to accomidate[/QUOTE] Where should the pointers be after a 1 is inserted? | |
Re: [QUOTE] getting error saying that the datatype for arraySum is not applicable for sortNumbers[/QUOTE] Please copy and paste here the full text of the error message. [CODE]int randomNumbers[] = {(int)(100.0 * Math.random()) + 1};[/CODE] What do you want to happen with this statement? | |
Re: [QUOTE] i want user to select column1 first then he choose column2 according to column1 and column3[/QUOTE] Can you explain what you are trying to do? I select a row in column 1 and then select an item in the dropdown list. And then what? | |
Re: Please post the full text of the error message that shows which line the NullPointerException occurs on. | |
Re: Have you tried to compile your code? Does it give compiler errors? You'll save some time if you compile it first before posting it with errors you don't know about. | |
Re: How can we help you write your program? Do you have any specific questions? | |
Re: Do you have a stack trace from when it crashes? | |
Re: Also see this cross post where various techniques were suggested: [url]http://www.javaprogrammingforums.com/whats-wrong-my-code/9528-cannot-find-where-extra-brace-causing-my-errors.html[/url] | |
Re: Why not start with a smaller program to get the techniques down. Then you could post it when you have problems. The posted code here is just too big for most people to work with. | |
Re: Why are you adding components in the paintComponent method? That method can be called many times a second to do a repaint. Also your paintComponent doesn't do any painting? | |
Re: Do you know how to write the HTML for this? | |
Re: How about using a window and making part of it transparent. | |
Re: I don't see any debugging println statements that would tell you how each variable changes and how the execution flow goes. If you understand your algorithm and can see when your code is not following that algorithm by looking at how the values of variables change, then the output from … | |
Re: You need to put all the images in the jar file. When you do that, you will need to change the way the image files are read from using disk files to using resources. There is lots of code samples on the forum that does this. Search for getResource and … | |
Re: [QUOTE] Just add each dir containing compiled class files to classpath! [/QUOTE] Really you need to put the dir at the head of the package path on the classpath. If a class is in package mystuff.work, the class file would be in the work folder and the classpath should point … ![]() | |
Re: There is too much jargon in your question and not enough java. A lot depends on how you want to access the stored data and what you want to do with it while it is stored. | |
Re: Cross posted at [url]http://forums.devshed.com/java-help-9/i-want-to-execute-my-jar-file-827597.html[/url] | |
Re: When I execute it I get the following when I press the button: [QUOTE]Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException at NewJApplet$1.actionPerformed(NewJApplet.java:74) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)[/QUOTE] Look in the browser's Java console for error messages. | |
Re: Does your code do what you want it to do? If not please explain the problem you are having. | |
Re: [QUOTE]the app does not satisfy the requirements[/QUOTE] Please explain what requirements you are missing. [QUOTE]assigning prices to the products and adding them for the total purchase value[/QUOTE] I'm assuming you have a Product class. Several ways to assign a price: in the constructor when the product object is created. Have … | |
Re: What class is the getText() a method in? What does the API doc say? | |
Re: Down load and install the Tomcat server. It has examples that you can play with. | |
Re: I'm not sure of your question. By web page I assume you mean what is displayed in the window of a browser. What is "Click on webpage" mean? Are you trying to position the cursor over the browser's window and click on the spot on where a Submit button is … | |
Re: What data type does the get() method return? What type is temp1? The == operator is for comparing primitives. For comparing the contents of objects use the .equals() method. | |
Re: [QUOTE]Compilator ignores the scanner and directly goes to else statement and puts it in the loop 10 times...[/QUOTE] What is a compilator? The Scanner class is tricky to use. It reads a full line including lineend into a buffer and then returns parts of what was entered as you ask … | |
Re: I see that the OP is still confused about % [QUOTE]£100 + 0.97% = £109[/QUOTE] 1% of 100 is 1 .97% of 100 is .97 | |
Re: Your uncommented code makes it hard to understand what you intend the code to do. For example what is the 1000 that is used two times in this statement: intrest = Math.abs(intrest *1000+.5)/1000; For better readability use a final int with a selfdocumenting name: final int ConvertFactor = 1000; Also … | |
Re: @coding101 How about explaining to the OP the trick in the second for statement. Spoon(Shovel) feeding a student with code he can copy and paste is not always the best way to get the student to think thru a problem and work out the solution. You learn by trying and … | |
Re: You've shown the file contents in text record format. Ie each record ends with a line end. The records can all be different lengths. To be able to use a RandomAccessFile to get to records randomly, each record must be the same length. Then the position of a record = … | |
Re: Are you having problems? Can you explain what the problem is? Look at using a Timer vs writing your own using Thread. Also its better NOT to use one of the standard Java class names for your class. | |
Re: Go to the Java tutorial and read about generics. Start here and find generics: [url]http://download.oracle.com/javase/tutorial/reallybigindex.html[/url] | |
Re: [QUOTE]java.lang.NoClassDefFoundError: AddFrame[/QUOTE] Where is the class: AddFrame. The JVM can't find it. You must have all the classes needed by the program on the classpath. One way this is done is by putting them all into a jar file. This must be done carefully to preserve the package paths to … | |
Re: The import statement is a way of telling the compiler where to look for class definitions when the class is in a package. It saves you from having to code the full package name when you use a class. Without the import java.util.Scanner; statement, you would have to code java.util.Scanner … | |
Re: [QUOTE] how do I return a value if I made another choices again and again..[/QUOTE] How do the additional choices effect what value is returned? Do you return one value for each choice or one value after all the choices have been made? Normally you talk about returning a value … | |
Re: [CODE]if ((grade>=90)||(grade<=100)) {)[/CODE] Does this return true if grade is 20? (note: 20 is < 100 so the second condition is true and the whole OR connected condition is true) Do you want both conditions to be true or only one of them? Both requires AND only one requires OR ![]() | |
Re: ztini seems to like to show off that he can write code, instead of helping students learn how to write code. Teach a man to fish vs giving him a fish. | |
Re: You need to save the previous total and add to it the new total. Where do you compute the total that is displayed in error? Where do you update it? ![]() | |
Re: Where do you output the value of salary? If it's printed on the console, please copy and paste the program's output here to show us what is output. A debugging technique is to print out the value of a variable every time it is changed. Print with an id String … | |
Re: First, have you read the API doc for those two methods? How have you seen them used? Do you have a code sample? | |
Re: The OP should try debugging his code to see what is happening. If no interactive debugger available, add printlns to the code to show the execution flow and how the values of variables change. |
The End.