- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
17 Posted Topics
I have done it by putting the array in a ArrayList.However I had to take the initial array as an Object[]. [CODE] import java.util.ArrayList; import java.util.List; /* remove zeroes from an array without using another array * * use ArrayList, then * * */ public class ArrRemoveElmZero { static Object[] …
Hi I have a simple jsp page in which there is an ajax call on an input string which returns the upper case of the string in json. This is working for the first time but not on successive requests. I am using the GET method. Why is it not …
Hi I am not been able to receive URL parameters passed from my ajax code in my jsp. Here is the code [CODE] function showDetails() { document.detailsForm.sltdUser.value = selectedUserID; alert('selectedUserID' + selectedUserID); var httpRequest; var url = 'showDetails.jsp?sltdUser = ' + selectedUserID; if (window.XMLHttpRequest) { // Mozilla, Safari, ... httpRequest …
Hi I am unable to pass value from one jsp to popup jsp. Code [CODE] <form name="detailsForm" method="post" onsubmit="return showDetails(this); "> <input type="hidden" name="sltdUser"> <input type="submit" value="Details"> </form> function showDetails(detailsForm) { detailsForm.sltdUser.value = selectedUserID; alert('selectedUserID :' + detailsForm.sltdUser.value); // works fine window.open('showDetails.jsp?abc =' + detailsForm.sltdUser.value); } [U]showDetails.jsp[/U] <% String abc …
Hi Can anyone please help me as to how to print in java? Please tell me the basics first and then how to change the configurations.Actually I need to print in a thermal paper for issuing tickets. Can anyone please help? Thanks Abhik
Hi I am using tomcat 5.5 and I am unable to connect to mysql server(Wamp2.0i). Here is my code: [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <html> <head> <title>Connection with mysql database</title> </head> <body> <h1>Connection status</h1> <% String connectionURL = "jdbc:mysql://localhost:3306/names"; Connection …
put the lists in a single arraylist(say arrlist) and use Collections.sort(arrlist)
hi pls check my post at this thread [URL="http://www.daniweb.com/forums/thread253670.html"]http://www.daniweb.com/forums/thread253670.html[/URL] this is already solved
[QUOTE=anevins;1110078]I need to use the valueOf method to return a string representation of a boolean arguement but I don't know how to use this method. Here is my code at the moment, if the inputted file name ends with .txt then 'true' is returned, if not then 'false' is returned. …
you can try the DocumentBuilderFactory and use : [CODE] Element elm = new Element("publishers"); document.createElement(elm); [/CODE]
have you instantiated the Set? if not it will not allow to add.
> `private static String[] alphabet2 = new String[alphabet.length];` You need to change the size of this array alphabet2 to alphabet.length + 1.Otherwise how can you accomodate the extra " " string?
You can try Collections.binarySearch(list,elementToSearch); However you need to sort the list first. So you can use: [CODE] Collections.sort(arrayList); Collections.binarySearch(arrayList,elementToSearch); [/CODE] If the element is found, then it will return the index,else it will return (-X-1),where X is the position that the element will take in the sorted list.
Hi I have written the following code and it runs fine.It takes user input and stores it in an ArrayList of student beans. It prints the students in descending order of grades.Hope it helps. [CODE] import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class SortStudentsByGrade …
Hi I have written the code for this.It works fine.Hope it helps. [CODE] import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; public class StringEx { int count = 0; String text; public static void main(String[] args) { StringEx s = new StringEx(); s.readFileToGetFileDescription(); } private void readFileToGetFileDescription() { …
It might be because of the equals you are using in the if statements.Try to convert it into toString() first eg: if(e.getActionCommand().toString().equals("Okay")) you are comparing an object with a string,you should compare 2 strings instead. Hope this solves your problem
Hi I have written this code and it runs successfully . Hope it helps. [CODE] import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.regex.Matcher; import java.util.regex.Pattern; public class SearchText { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter Text: "); try { String text = br.readLine(); …
The End.
AbhikGhosh