2,777 Posted Topics
Re: Please edit your code and surround it with code tags. Or post it again in code tags. Code tags given by upper right icon. BTW your code is an application not an Applet. | |
Re: Where are the println()s for debugging? You need to output variable values so you can see what your code is doing. See post on thread: [URL="http://www.daniweb.com/forums/post1312708.html#post1312708"]http://www.daniweb.com/forums/post1312708.html#post1312708[/URL] | |
Re: [QUOTE]i got xlint error during compiles[/QUOTE] When you get an error, please copy the full text and paste here. It saves a lot of guesswork. ![]() | |
Re: Explain what you want the code to do in more detail, and we'll try to help you find the java code to do it. Something like this: Start the timer, connect to a website, upload/download a large number of bytes, end the timer and compute: bytes sent/unit of time | |
Re: [QUOTE] I need to change this to accept any input.[/QUOTE] What are the possible sources for input? Files, internet connection, GUI text boxes, console input? If its console input, look at the Scanner class. There are many code samples on this forum for you to look at. Use the Search. | |
Re: Please repost your code using the code tags (use icon above to right of text input box) To debug your code, add println() statements to show the values of the variables that control the location of the balls. Show these values when they are changed and when they are used. | |
Re: Do your browser's have a Java console? Are there any error messages in the java console? Why does the second html post show the bin folder when the first one did NOT? CODE = "bin/JDemoGraphics.class" vs <APPLET CODE = "JDemoGraphics.class" Which one are you using? | |
Re: [QUOTE]If someone would validate whether or not this code is okay[/QUOTE] How do we tell if it is ok? What are the criteria? Can you explain what the code is supposed to do? I can't see any comments in the code describing what it does. | |
Re: Having multiple methods with the same name is known as method overloading. It looks strange, but the compile can figure it out because the args to each method are different. The overloaded methods should have the same functionality. In your case they don't, so it be better if the method … | |
Re: One approach would be to break the code up into methods and have a master method that calls the other methods in the order you want them called in. You need to use a state indicator to remember where you are and what you have done to control what to … | |
Re: [QUOTE]need to modify some pixels from int (0-255) values to double values[/QUOTE] Are pixel values whole numbers in the range 0-255? Can you edit your post and reenter the text of the error message to preserve the line ends? What line of code in your program caused the error? [QUOTE]I … | |
Re: [QUOTE]I want to know if my math in the code and by hand is wrong [/QUOTE] Can you explain what your algorithm is and what you are trying to do? The title for this thread is Binary to Decimal. What format is used to represent these values? Are they both … | |
Re: Have you read the API doc for the text field classes? There are methods for setting the text that it displays. In Swing look at the super class for JTextField. If you have the data in a String or convert it to String, then you can put that String into … | |
Re: See cross post at [URL="http://www.java-forums.org/new-java/31802-stack-can-t-pop-off-see-code-java-problem.html#post139396"]http://www.java-forums.org/new-java/31802-stack-can-t-pop-off-see-code-java-problem.html#post139396[/URL] | |
Re: [QUOTE]I need a get method which will receive the position of the variable (1,2, or 3) and will then return the variable at that position. [/QUOTE] Sounds like an application for an array. Change the word "position" to index and 'variable' to element and you're talking about arrays. An array … | |
Re: Strange place to ask for c++ code. | |
Re: Where is the ex_sample.class file when you execute the 'java ex_sample' command? Can the java command "see" it? The default classpath is the current directory. | |
Re: [QUOTE]bad class file: ./HelloWorld.java[/QUOTE] Why is it refering to a .java source file as being a bad class file? Is this an IDE configuration problem? What command do you execute to generate that error message shown in red? | |
Re: You'll probably need a LIFO stack to keep track of opening tags for matching with closing tags | |
Re: A suggestion, test text1 string is long enough before doing: coordinates1[i][2]= Double.parseDouble(text1.substring(46,56)); | |
Re: Have you tried the other write methods in the ObjectOututStream class? There are methods for different data types. [QUOTE] why I have to use the ".flush" method after using an InputStream object[/QUOTE] I don't know why you'd use flush with an InputStream. | |
Re: First thing is try to debug the code by adding println()s to see where the code is executing. The code does not compile: [CODE]ClickyLatinHelp.java:78: cannot find symbol symbol : class Lists location: class ClickyLatinHelp.DrawingArea Lists listhi = new Lists(); ^ ClickyLatinHelp.java:78: cannot find symbol symbol : class Lists location: class … | |
Re: While debugging I'd add a trailing else: [CODE] } else if (e.getSource() == exitBtn) { }else { System.out.println("unhandled action " + e); // tell em about it } [/CODE] | |
Re: Have you looked at the RFC for the File Transfer Protocol? | |
Re: Have you defined a second array with the same name inside the loop, hiding the public one? | |
Re: [QUOTE]the datatypes are incompatible[/QUOTE] Do you get errors? Please copy and paste the full text of the messages here. | |
Re: Add this to your code to see what you are passing to acos(): System.out.println("acos arg=" + a*(180/3.14)); // show the arg | |
Re: [QUOTE]// list of servers and up or not - the tab thing [B]needs some work[/B]...[/QUOTE] The comment says it all. Where are the arrays with the servers and the Up/down settings? You show one named: hostarray, now you need one for the status. Read up on how to use a … | |
Re: [QUOTE]can i do it in other way beside database?[/QUOTE] Yes but. As an alternative you could design a way to use files and folders to store your data. The keyword here is design. Some day though you will have to learn databases. | |
Re: [QUOTE]variable wage might not have been initialized[/QUOTE] Give it a value when you define it. Add a / in the ending code tag | |
Re: [QUOTE] gives me my error message - "problem with showdata" [/QUOTE] Where does that error message come from. I don't recognize it as a java error. Is it generated by the program? If so, no one can help you without seeing the code that generates the error messsage. Do you … | |
Re: Or you could test if the String is empty by using the String's length method. | |
Re: [QUOTE]how do i eliminate the word "do" from each of the tokens? without affecting the number of tokens involved?[/QUOTE] Not sure I understand what you are asking. 'do' is a token. It is not contained within any other tokens. Are you asking how to remove one token ('do') from a … | |
Re: [QUOTE] how can i add two points of x-coodinate and two points of y-coordinate ??[/QUOTE] Can you explain what you are trying to do. Say you have two points given by x1, y1 and x2, y2 What does "adding" these two points mean? Can you give an example? | |
Re: Please edit your posted code and add code tags (upper right icon/link above this text field) to preserve the formatting. [QUOTE]Nothing works[/QUOTE] That'll make it hard to help. Can you ask specific questions about your problem? | |
Re: [QUOTE]For example, java ShowStars 2 3 1 4[/QUOTE] First comment about your code is that it doesn't follow the example you show. The String[] args passed to the main() method would contain the args shown by your command line: args[0] is 2, args[1] is 3 etc [QUOTE] it is still … | |
Re: Please edit you program and add code tags to preserve the formatting. Use the icon to the right above the input text field: [ code ]. [QUOTE]Exception in thread "main" java.lang.NumberFormatException: For input string: "GTR"[/QUOTE] Where did the input the string "GTR" that shows in the error message come from? … | |
Re: How would you solve this problem if you had to write down everything vs remember the numbers you were given? Say you had two pieces of paper, one for largest and one for smallest. I give you a number. What would you do? You'd compare what I gave you to … | |
Re: Your program does NOT compile. I get 54 errors. Could you fix it? Also please preserve the indentation when you post code. Unformatted code is very hard to read. | |
Re: [QUOTE]if its not a constant then how will i use it in a case[/QUOTE] I don't think you can use a variable with case. You'll have to use if() in the default: section. Can you define what the code is supposed to do? | |
Re: @nickguletskii How are you helping the OP learn programming by solving his problem instead of teaching him how to solve his problems? Can you take the time to describe to the OP how you found the problems? And give the OP some hints on how he can do it next … | |
Re: If your going to post code examples, at least you could check if it works. [CODE]CD_Finder.java:18: cannot find symbol symbol : method GCD(int,int) location: class GCD_Finder.GCD System.out.println("GCD of "+num1+" and "+num2+" is "+obj.GCD(num1,num2)); ^[/CODE] | |
Re: std1.RollNo = 2000; Here you are referencing a class variable RollNo using an existing object: std1 Each Student object you create will have one of these variables. You need to use the object reference variable(std1) to access the variables in that object Student.stdcount Here you are referencing a static variable: … | |
Re: Where are all the files (jar, class, html) when you try to open the html page in a browser? Is the planetary class in a package? What messages are in the browser's Java console? Please copy and paste them here. | |
Re: Is this the same post as: [URL="http://www.daniweb.com/forums/thread304297.html"]http://www.daniweb.com/forums/thread304297.html[/URL] | |
Re: Your problem is you are passing the wrong args to the ImageIcon constructor. Read the API doc to see what kind of String value is valid and whether there should be another type of arg used. |
The End.