1,963 Posted Topics
Re: Then use a separate String variable. In the for loop concatenate all the elements of the array into that String variable and then display that variable. Initialize it outside the for loop. Give it value in the for loop. Then after the loop display it. [CODE] strArray += array[k] + … | |
Re: Maybe you should convert the char that you get to an int. Convert this: '2' to the int 2. Instead when you do this: [CODE]int i = '1';[/CODE] You are not setting the int 1 but the ASCII value of the character '1' which is something else. Try something like … | |
Re: From what I see you have your select tags inside a for loop? That would mean that the html generated will have more than one <select> tag. If you use the request.getParameter, it will always return the first value. But you send at the request many <select> "items" with name … | |
Re: At errors you get it says this: [B]at JFrameDemo.main(JFrameDemo.java:8)[/B] What does it say at the line 8 of the file JFrameDemo.java. Something there is null | |
Re: You have 2 for loops one inside the other. And if you omit the code inside them you get something like this: [CODE] for (count=0;count<11;count++) { for (count=0;count<frequency.length;count++) { } } [/CODE] You are using the same variable to access two entire different arrays. And the fact that they might … | |
Re: In the WordCheck constructor you have it backwards. You are suppose to set the value of the class attribute wordsUsed. Instead you change the argument and the wordsUsed attribute of the WordCheck never takes value and it is null. Also what is the purpose of the condition method ? It … | |
Re: [QUOTE=seemant gupta;793886]is there any book from which i can learn net beans[/QUOTE] Try the tutorials of the net beans site. And net beans is an IDE that helps you organize your projects. Shouldn't you been learning java? | |
Re: It should be && instead of || And why do you use the + It is not necessary. Also you don't need this: [CODE](uInput1 > uInput2 || uInput1 > uInput3)? +uInput1: +uInput2[/CODE] If the uInput1 is not the max, then why do you assume that the uInput2 is the max? … | |
Re: You can call the Integer.parseInt(String) method and if it throws an exception then it is not an int. | |
Re: [QUOTE=braggy58;1276678]i badly need this before july 21,[/QUOTE] Start a new post, use code tags, and give more explanations. What is wrong with your code? What is your question? | |
Re: [QUOTE=balaji153;1275414]i am php developer , do i need java knowledge before learning jsp , if yes why so?[/QUOTE] Yes, you do need java, because JSPs are basically html code with java inside. You need to know calling methods, creating custom classes, creating instances of those classes. You cannot just start … | |
Re: properties is an array. It doesn't have these methods: printPropertyDetails, addProperty. For printing loop the array and take each Property object from the array and print that. As for adding you need to do what you do at the beginning of your program. You have the count variable. So add … | |
Re: You need to find a way to read the excel file. Once you do that, then it is easy. Call methods that save values to the database and pass as arguments the values read from the excel. You will need 2 different things. Write methods that write to the database. … | |
Re: [QUOTE=shrekting;1274376]I post reply for those persons whose pc could dispaly chinese and who can understand chinese ,not u who can only code in english! u r not internet men,but me! byebye daniweb.com![/QUOTE] And what if someone has a problem and expects an answer. Does he have to know Chinese to … | |
Re: IF you know C# then you will have little difficulty converting it to java on your own. It will not take you much time to read a few things about java. If you know C# you don't need to learn anything new, just understand a few things about how java … | |
Re: The error is very clear: [B]symbol : variable lengh[/B] from the errors that you get. Learn how to read them and give it a try, before posting here It says it cannot find the symbol lengh. Check your book or the tutorial you took the code from. It should say … | |
Re: This thread has been solved but I would also like to add a small suggestion. If for some reason you want to use ints for boolean expressions, why don't you make a class for it. Call it: BoolInt. Have it have one int [U]private[/U] attribute and with the help of … | |
Re: First of all what errors do you get? Second, does the 'one' class has a 'newinstance' method? I don't see any so there is your error. You haven't defined a newinstance method. Maybe you should try this: [CODE] try { one obj = (one)Class.forName("one").newInstance(); obj.one(); } catch (ClassCastException cce) { … | |
Re: Start coding those method in one class. In another put your main method and call those methods. What this: "[U]A program that will ask only 3 times for inputting the correct password.[/U]" has to do with the rest of the requirements. Start some coding and don't expect us to do … | |
Re: [QUOTE=merinajose;1235466]Hi I need code for searching the records in a table for specified conditions using jsp[/QUOTE] Start a new thread and post some code | |
Re: About this problem: [CODE] if(All.charAt(count2)!=dot) { sNumber = sNumber + All.charAt(count2);/ it wont let me initialize this command, i dont know how to initialize it, so that it would work } [/CODE] I cannot find where you have initialized the sNumber. Maybe you should change at the beginning of your … | |
Re: Also, you put "pieces" in some of the elements of the array. The rest are unfilled, so they are null. I would suggest to fill all the array with empty Strings "" in order to avoid the NullPointerException. Then put to the elements you want the "pieces". And if you … | |
Re: Actually you have a small misunderstanding with that logic. The API says: "The ordering imposed by a Comparator c on a set of elements S is said to be consistent with equals [B][U]if and only if[/U][/B] " The API says at some point that the compare method does not have … | |
Re: [QUOTE=idontknow19;1262453]no i not study arrays yet.my mentor said.i need to create a program a long method without using the methods or package in arrays like array.sort. BUT my mentor said I need to input 5 numbers or integers...thats only my problem.im stuck or i get confused what to do next.what … | |
Re: The fonts of what? If you are referring to Swing then I believe that the classes have set methods for that. Look at their APIs | |
Re: Check the API of ArrayList. [U]Never[/U] assume that classes and methods do what you think they do. The argument you have specified is the initial capacity of the ArrayList, not the size. Check the constructors of the ArrayList class. From the API: [QUOTE] Each ArrayList instance has a capacity. The … | |
| |
Re: Don't forget that if you need to compare Strings use the equals method. The code provided will not work because this: "==" does not work when comparing Strings. Also another mistake to your code [I]Taywin[/I] is that you have getAnswer non static. You cannot call it the way you have … | |
Re: Try "right" clicking on the file and select "Properties". You will find the exact location and file name to use at your code | |
Re: [QUOTE=ziniya;1256669]pls solve my problem urgently 1 * *** ***** *** * 2 ***** ** ** * * ** ** *****[/QUOTE] Why ? | |
Re: First check some html and javascript tutorials because that code is totally wrong. It needs to rewritten from the beginning. I would suggest this: [URL="http://www.w3schools.com/default.asp"]http://www.w3schools.com/default.asp[/URL] First learn about html and then move to javascript | |
Re: I haven't tried that code. You need to check it yourself. But I would suggest this, if you want to have more chances of succeeding. [CODE] <% request.setAttribute("[B][COLOR="green"]info[/COLOR][/B]", "info from page1"); %> .... <%=request.getAttribute("[COLOR="green"][B]info[/B][/COLOR]")%> [/CODE] | |
Re: [QUOTE=lonely gurl;1120877]guys, help m plz.. i need a java code that separate a number from words..[/QUOTE] Be more specific, start a new thread and show what you have done so far | |
Re: Have you tried to check the error messages you get? The first piece of code will result to a NullPointerException since you don't initialize the array. If you didn't accidentally forgot to do that, then forget what you are doing and try to learn basic java first. At the second … | |
Re: Check the announcement at the top of this forum: [B]Starting "Java" [Java tutorials / resources / faq][/B] It has plenty of resources to choose from | |
Re: Have you declared the variables username, password? Perhaps you need to show more code. Also the above code is html code, not a scriplet. Does it compile. | |
Re: Just a suggestion for you to check. It might not work: [CODE] var url = 'showDetails.jsp?abc =' + detailsForm.sltdUser.value; alert(url); // works fine window.open(url); [/CODE] | |
Re: Check the constructor of the class java.util.Date at the API. I doubt the there is one that takes as argument the String that you are trying to pass [U]txtFieldArray[i].getText()[/U] Check the API of java.util.Date as well as the class: [B]java.text.SimpleDateFormat[/B] And you will get your answers: [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html"]http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html[/URL] | |
Re: What you posted is unreadable. Use code tags. Click the button: (code) and place your code inside | |
Re: Show some code, give more information and use: [CODE] request.setAttribute("key", object); request.getAttribute("key"); [/CODE] | |
Re: Try looking at the API for JOptionPane class. Focus on the static methods that start from show..... | |
Re: Try to run the query first at the sql prompt and see if it works then takes it and put it at your statement. Post the errors that you get. | |
Re: I assume that the according.jsp is an empty jsp that has only DB code and nothing else. Then when you are done, you can write code using the <forward> tag to redirect to the initial page. You can also send the data saved and display them. This time you can … | |
Re: Have you considered using: while(hasNextDouble) | |
Re: Use the classes java.util.Date with the java.textSimpleDateformatter, or/and java.util.Calendar | |
Re: [CODE] <a href="page.jsp?param1=value1¶me2=value2¶m3=value3">Link</a> [/CODE] Notice that only the first parameter has the '?' . The rest are separated by the '&' symbol. And at the jsp you can do this: [CODE] String a = request.getParameter("param1"); // value1 String b = request.getParameter("parame2"); // value2 String c = request.getParameter("param3"); // value3 [/CODE] | |
Re: Loop the array and print only those that are not zero. Also I would suggest to initialize the array: shapeIndexes to have all -1 as initial elements. With the way you initialize it, it begins with zeros. So if it happens that the selected shape is the first element of … | |
Re: How do you want it to be passed? I mean if don't click a button, you must perform an action to send the data. If the user enters a value at the input field, then the user must also do something to send the data. What do you want the … | |
Re: [QUOTE=mohamed mo'men;1237704]there is Inheritance mean subtype polymorphism or there not have same job ??[/QUOTE] What ? |
The End.