1,963 Posted Topics
Re: The code has already been provided posts ago. It has been also established that we shouldn't give ready code, rather than help the poster find the solution. Now why do you think [I]mnmw[/I], that Megha's post had any meaning? He posted code that had already been posted and gave solution … | |
Re: But why would you want to add them. I assume that they are coordinates. What is the meaning of adding coordinates? Sure they are numbers and arrays and you can add them, but I don't seem to know any mathematical theorem that it requires the addition of the X,Y,Z coordinates. … | |
Re: Your code tags should end. Also you need to be more descriptive. What your program is suppose to do? What kind of errors do you get and what output | |
Re: [I]jon.kiparsky[/I] has already solved your errors. Read his suggestions and your error messages. You have an else without an if. It is: [CODE] if () one command; else one command; [/CODE] For multiple commands use {} When you don't put {} at the [I]if[/I], only the first line after the … | |
Re: Have you even bothered to read it? It says: "Column not found". Now what do think could be the problem? Also the error message tells you exactly the line where that error occurred. It is not that difficult to understand that you are trying to read a column that doesn't … | |
Re: If you want to add a picture at the GUI, you need to look at the API of the JLabel class. It has a constructor that takes as argument an Icon. Or you can the method: setIcon. From the API the argument (Icon) is an interface, so you need to … | |
| |
Re: Inside a for-loop you will have a System.out.print("*") How many times will this for loop will execute will determine how many * you will have at each line. Then you will put it in another for-loop which you will use to determine how many lines you will have: [code] for … | |
Re: Check out the indexOf method of the String class: [CODE] String s1 = "www.google.com/search/" String s2 = "google" int index = s1.indexOf(s2); System.out.println(index); // 4 [/CODE] If "index" is -1 then the s2 is not inside the s1. Else it returns the position of the s2 inside the s1, which … | |
Re: You are calling the next method twice, without checking if it has a next element: [CODE] out.print("coming..................:"+itr.next()); out.println(itr.next().toString()); [/CODE] The first next call will return since you did that check at the while, but the second will not because you take the next element and you don't know of it … | |
Re: You need to post what errors do you get. Don't expect that is easy for us to take your code and run it. Or that we read it line by line and expect to understand what you were thinking. Also I happened to run the latest code and this is … | |
Re: Your code is unformatted and you failed to indicate where the error is. Reade the error messages that you get. Don't expect others to do it for you: [QUOTE]Exception in thread "main" java.lang.NullPointerException at Bank.main(Bank.java:25)[/QUOTE] At the file Bank.java line 25 you got a NullPointerException. You are trying to use … | |
Re: There is no such method, you need to create your own: [CODE] String strNum = "fifty"; int num = 0; if (num.equalsIgnoreCase(fifty)) { num = 50; } [/CODE] | |
Re: I agree with you guys(Ezzaral, masijade). I have seen many threads here where people just post the code, the line the error is and the message the compiler gives. But the compiler explicitly says what EXACTLY is the problem. It says the line and explains the problem and sometimes says … | |
Re: What class is this: d.ymd ? Did you write it. How do you expect to call d.dmy if such method doesn't exist. Look at the API of java.text.SimpleDateFormat, for formatting Date objects to Strings | |
Re: You can create a separate java file. That class would be the form. It will have fields and labels and buttons. When you select the option, instantiate that class. It should extend the JFrame class. So when you create that instance and make it visible enter whatever you want. You … | |
Re: Better use the log4j.properties option better. Or if you look at the API you can programaticaly configure the log4j. Also check this out: [URL="http://www.vipan.com/htdocs/log4jhelp.html"]http://www.vipan.com/htdocs/log4jhelp.html[/URL] | |
Re: If you want something converted to int or double do what you [U]correctly[/U] did [CODE] interest = (int)(.....); [/CODE] Of course you were trying to convert rate to a double too. I haven't looked what is its type but if it is not double and you want it to be … | |
Re: Try to print this: [CODE] String s11="INSERT INTO "+table+" "+" VALUES(mani,'"+image+"')"; [/CODE] Before executing it. What happens is that when the String s11 is constructed this is trying to take value: [B]"+image[/B]; It "converts" the image java instance to a String. Meaning this is called: [CODE] String s11="INSERT INTO "+table+" … | |
Re: You don't use arrays, you use a [URL="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Vector.html"]Vector[/URL] Search for tutorials about Vector and/ or lists in general (ArrayList) With Vectors you can add as many elements as you want it doesn't have a fixed size. Whenever you add more its size increases automatically, so you can add more. You … | |
Re: From the errors I assume that we are dealing with Applets so there shouldn't be any main method. If you want to use something anywhere then declare it, create it and initialize it. Without some code to go with the errors it is difficult to suggest anything than speculations | |
Re: Try to read what the hashCode method really does and what it is used for. Check the API of the Object class, as well as the API of the HashMap. Also don't use '==' to compare Strings. Use the equals method of the String class. And you also need to … | |
Re: This is a java forum not a jsp forum. Search for the jsp forum. [QUOTE] if you know show it please [/QUOTE] Why? Why would we show you the code? What do we have to gain? | |
Re: [QUOTE=simitis;1088922]You just need: name=null; and garbage collector will do the rest.[/QUOTE] Can you be more specific on that? What do you mean? Can you post some more code? What is it supposed to be set to null? | |
Re: Even if you do write code that create a file with the .jsp extension and save it at the server, what would be its use. You would still need to call it and display it to browser. Even if you create a dynamic link based on the name of the … | |
Re: [QUOTE]Remainder after dividing 278 by 10 = 2[/QUOTE] The Remainder is not 2, it is 8. (modulo operation) 278/10 = 27.[B][COLOR="Green"]8[/COLOR][/B] Take the number as a String. Actually it should be treated as a String to begin with: "458343238143257" Use the String class to convert that into an array of … | |
| |
Re: [QUOTE=jon.kiparsky;1295878] [CODE] private While w; public static void main(String[] args) { w = new While(); } public While() { printLoop(); doSomethingElse(); etc. } [/CODE] [/QUOTE] The Code that you wrote [U]jon.kiparsky[/U], will not compile. Please don't post code that you haven't tested. Also it is better to learn to call … | |
Re: When do you want the validation to happen? When you click the submit button? An easy way would be to have a button(type="button") and an onclick event: [CODE] <input type="button" value="Click" onclick="validate();" /> [/CODE] Then define a [ICODE]validate[/ICODE] function, inside it use javascript to take the values of the fields … | |
Re: This is a bit late for answering but I am surprised that no one mentioned anything like Gundam Zeta or Yamato. Well if you want to hear it from someone who has seen a lot then here it is: [U]Series:[/U] Yamato Season 2 (Unfortunately in the US known as Starblazers) … | |
Re: How are we suppose to know what is wrong? Do you get any errors? Also at the toString method you do [U]correctly[/U] this: [CODE] public String toString(){ StringBuffer sb = new StringBuffer(); for(int i = 0; [B][COLOR="Green"]i < this.count[/COLOR][/B]; i++) sb.append(items[i] + ", "); return sb.toString(); } [/CODE] You use … | |
Re: when you submit the form, what is the action attribute. Maybe you need when each button is clicked to submit to a different jsp page. From there you will need to retrieve the data from request: [CODE] <a href="retreive.jsp?EmployeeID=<%=previousId%>">Previous</a> <a href="retreive.jsp?EmployeeID=<%=nextId%>">Next</a> [/CODE] You will also need to post more code … | |
Re: Because this is null: [CODE]request.getParameter("txtname")[/CODE] Try to learn first jsp before attempting such code. You need to use javascript. And don't do that: [CODE]<% out.println(....); %>[/CODE] Use <%= ....%> . It is the right way. | |
Re: I have never tried what you want to do but a quick look at the API will get you what you want. Have you tried looking at the API of the JButton class. If you look at the constructor there is one that accepts an Icon. If you search the … | |
Re: The error says: test.java (at line 3) What code do you have at lines 1,2 ? Have you posted the entire code? What java version are you using? Scanner is available at 1.5 and later | |
Re: There shouldn't be any problem with NetBeans or any other IDE. The code not working rarely has anything with the IDE. If you have some code that you can't get to work just post it with specific questions. But first read some tutorials on how to read data from database … | |
Re: Try to print the query, and then take it the way it is and run to an sql editor: [CODE] String q="select order_num from Order where recev_fname='"+itemn+"'"; System.out.println("Qeury: "+q); [/CODE] | |
Re: What errors do you get? Also it is good to declare this: [ICODE]BufferedReader br=new BufferedReader(new InputStreamReader(System.in));[/ICODE] outside the for loop. Also you'd better add this in order to know what was the problem: [CODE] catch(Exception e) { System.out.println("Problem with the program: "+e.getMessage()); } [/CODE] | |
Re: In One jsp have the form with all the fields and a submit button: [CODE] <form [B][COLOR="Green"]action="two.jsp"[/COLOR][/B] name="someName"> ..... <SELECT name="month"> <OPTION selected value="01">1</OPTION> <OPTION value="02">2</OPTION> </SELECT> ..... <input type="submit" value="I authorised this transaction"> </form> [/CODE] And in the other jsp: two.jsp [CODE] String monthSelected = request.getParameter("month"); [/CODE] | |
Re: [QUOTE=WILSONOTIENO46@;1289802]WRIGHT A PROGRAM IN C WHICH REQUEST SCORES STORES THEM IN AN ARRAY , THEN IT CALCULATES THE MEAN, Deviations FROM MEAN, STD DEVIATION AND THEN IT PRINTS THE THREE(MEAN, AVERAGE, DEVIATIONS, STD DEVIATION.)[/QUOTE] Don't yell( meaning don't use capitals) we are not DEAF. Also start a new thread. Also … | |
Re: what is a school time table project. explain further and post your requirements | |
Re: Why should we write such program. I have no use for that, and I am not interested in finding the longest substring in two given strings that is common to both. Some things are better left unknown. If you want to find the longest substring in two given strings that … | |
Re: [QUOTE] Hi Friend, Am offering ready made project in java...it cost of 10000 payment and am having more project like this if yr friends interested u can make them call to me... If u needed contact me.... [/QUOTE] The 10000 is it in US Dollars or in Euros?:) Because I … | |
Re: In the same way you do it in any other class with any other object. In one class make that object as a global attribute and either set it to be public or use get/set methods. [CODE] public class OneFrame { public SomeObject so = null; // create it in … | |
Re: Check the API of the ArrayList class. There is a remove method that you can use. Or you can use the Vector class that is similar to the ArrayList. Check their APIs to find a method "remove" that is suitable for you. | |
Re: Posting the error message that you get, would help a lot. | |
Re: Why it is saved like this: a%20b%20c%20d How to you send the values and how you retrieve them? | |
Re: The error is very clear: [QUOTE]java.lang.String cannot be cast to java.lang.Integer[/QUOTE] You are trying to cast a String object to an Integer. That cannot be done. They are not of the same type. The error tells you at what line of your file that happened, so you can correct it. … | |
Re: Have you tried looking at the BigInteger class: [URL="http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/math/BigInteger.html"]http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/math/BigInteger.html[/URL] |
The End.