2,777 Posted Topics
Re: There is just one Thread class. Read about the JVM to see how it uses threads. | |
Re: The compiler doesn't see how a return would be done if the exception were thrown and the catch block executed. You need to add a default return. Perhaps a better way would be to assign the value to a new char variable inside the try{}catch. If that throws an exception … | |
Re: Check your equality tests. == is equality, = is assignment | |
Re: Are there two parts to your question? 1)draw the shapes of images in the BLUE rectangle to the right of the pane. 2)get a jpeg/png/tiff image from say photobucket or another online server, and draw it on there. There could be a problem here. Unsigned Applets are not allowed to … | |
Re: Please copy and paste the full text of the error message. And show the full text of the line where the error occurs. For example Your posted source line was not ended by a ; You have lots of syntax errors and misplaced } I'm surprised your IDE let you … | |
Re: Can you explain the algorithm you are using as comments in your code? Can you show the current output from the program and can you show what the output should be? You left off the import statements. The code will not compile without errors | |
Re: Also: When posting errors, please copy and paste the full text Cross posted at: [url]http://forums.devshed.com/java-help-9/how-i-can-apply-blinking-in-chat-program-819056.html#post2646403[/url] | |
Re: [QUOTE]it doesn't seem to work [/QUOTE] it would save time if you described what it is doing now (show examples) And describe what is wrong with it And show what you want the results to look like One way to show the contents of an array is to use the … | |
Re: What do the install instructions say to do? You talk of policy files(extension=.policy) and of jar files(extension=.jar). What were the file names of the files you installed? | |
| |
Re: Add some println statements to show the values of the variables as they change and are used. The output should show you where your logic is wrong. For example: System.out.println("xaxisWave1[z][360]=" + xaxisWave1[z][360] + " for z=" + z); | |
Re: calls to repaint should cause a later call to paintComponent? Is paintComponent being called? Add printlns to show call to repaint and call to paintComponent. | |
Re: It depends on what the SubUser (subUser using standard naming conventions) does. If it doesn't do any Swing GUI things or run too long, it should be OK. What does the subUser method do? | |
Re: How does this relate to Java programming? It looks like a Comp Sci problem. | |
Re: [QUOTE]I am having trouble separating them.[/QUOTE] Not sure what this means? Your code appears to try to get the source component for the event. Print out what is returned by the getSource() method. You are assuming that it is a String. Also read the API doc for the getSource method. … | |
Re: Can you post the code you are describing? How did you call repaint()? Have you added debug println statements to verify which repaint() calls are being made and which paint methods are called and in what order? | |
Re: [QUOTE]pages = input.nextDouble();[/QUOTE] Number of pages is usually a whole number. Can your app have 4.2 pages? | |
Re: Cross posted at: [url]http://forums.devshed.com/java-help-9/i-dont-know-any-thing-819566.html#post2647066[/url] | |
Re: Read the JDK doc about how to use the java command. Basically enter: java CLASSFILENAME where CLASSFILENAME is the name of the .class file. If in a package there is more to it than that. No idea how Eclipse works. | |
Re: If you call the newly created GUI object, do you expect the label to change for an existing GUI object? You need a reference to the existing one to change its label. | |
Re: [QUOTE] only results in stuff like sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1ce669e,sun.net.[url]www.protocol.http.HttpURLConnection[/url][/QUOTE] Is that the output from the toString() call? Looks like info about the class object your created. What did you expect to see for a URL object? [QUOTE]This gives me the pure HTML code.[/QUOTE] Does that include the javascript code? | |
Re: [QUOTE] at java.awt.Container.add(Container.java:927) at jPad.jpad.<init>(jpad.java:18)[/QUOTE] You'll need to know how to read the error message. Here are two lines with some info. Read from the bottom up until you find your java class. (jPad) That line has the source line where the error occured: 18 and shows what method you … | |
Re: Read the API doc for the String class. Does it have a setFont method()? To find which classes have the setFont() method go to the API doc page. At the top of the page is a link labeled: INDEX Click that and then click on the letter S. Do a … | |
Re: Look at line 65 in your code. The condition contains an assignment statement. Is that what you want? | |
Re: [QUOTE]it says that the class uses a deprecated API[/QUOTE] Can you post the full text of the error message? If you don't have the source, can you post the Machine.class file. There are utilities that can show what classes and methods it uses. For example, try decompiling it. | |
Re: Scanner class can be tricky to use. Scanner reads and saves what you enter in a buffer and then returns tokens to the next... calls except for the nextLine call which returns it all. Write a simple test program to test the different next... and has... methods to get a … | |
Re: Please edit your code and add CODE tags to preserve the formatting. See [url]http://www.java-forums.org/misc.php?do=bbcode#code[/url] If you want your text field all by it self at the top of the window, you'll need to use another layout manager. You can nest your usage of layout managers. Have one for the textfield … | |
Re: [QUOTE] an easy solution for creating new arrays while runtime[/QUOTE] use the new statement to create a new array. After creating them and filling them, they can be added to the ArrayList. | |
Re: I don't know how to do it in netbeans. In java, you would add a listener to the button and when the button is clicked and the listener code is called, you would open the new form. | |
Re: [QUOTE]because then the information wouldn't match.[/QUOTE] Can you explain what you are doing and how you can use java code to solve your problem? The use of the word script is confusing. Java is a compiled language. I think of scripts as being "executed" by an interpreter that reads the … | |
Re: When you run from a command prompt, you'll have fewer IDE things going on to potentally confuse you and will see the output from the JVM without any editting by the IDE. Also when you get past the development stage, and want to have the code be runnable from a … | |
Re: [QUOTE]implements ActionListener //Error: Absolute is not abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener[/QUOTE] The text of the error message describes the problem. Remember that java is case sensitive. Check your spelling. | |
Re: Be sure to explain the environment such as what IDE are you using. | |
Re: [QUOTE]Is there a way to set the contents of a JFrame to a jar file?[/QUOTE] A jar file contains files. Just about any type of file can put put in a jar file. In that context, what do you mean by the above? By putting the jar file on the … | |
Re: I suspect that it is the age old problem of == and Object references. The == with object references tests if the two variables refer to the same object. Generate the byte code and look at it to see what the compiler is doing. | |
Re: Call your ISP and ask it how to increase your speed. | |
Re: The example you show is for String B to be 1/2 of String A, case ignored. Perhaps that is too simple an example. The indexOf method would give you that (both Strings changed to the same case). Do you have any more complicated examples? ![]() | |
Re: [QUOTE]I tried using a variable that would contain the string which would be the location of the image and then setting that variable as a different string when the object is shot but that didn't work so well[/QUOTE] Why use a String instead of a class containing ints to hold … | |
Re: Would the time displayed by the JavaScript code (via new Date()) be different from the time the java program would get from the system using some class? | |
Re: Read the API doc for the Scanner methods you are using. There is a section of the doc that describes the exceptions a method throws and the reasons. | |
Re: Read about how to use the HTML APPLET tag. Create an html page using the Applet tag and make your class files available by putting them in a folder or in a jar file and have the Applet tag attributes point to their location. | |
Re: Do you want its display to replace the page with the applet or to be displayed on the same page with the applet, say in a textfield? | |
Re: Add some debug code to print out the values of all the variables used in the expression and post them so we can see what the values going into the expression are. Copy and paste the console output here. | |
Re: hide it by using the setVisible method | |
Re: When the method WORD1 has the 4 letters required, have it do a return. Execution will then return to the main method where WORD2 will be called. See cross post at: [url]http://www.java-forums.org/new-java/43960-hangman.html#post208262[/url] | |
Re: Or the array could be boolean vs int and set it true if the number has been used. | |
Re: See answer on other forum: [url]http://www.java-forums.org/new-java/44207-add-click-method-all-jlabels.html[/url] | |
Re: [QUOTE]I keep getting errors[/QUOTE] Please copy and paste here the full text of the messages | |
Re: The end of the program's code is missing. Could you explain what [B]my buttons arent working[/B] means |
The End.