1,963 Posted Topics
Re: Your code is a mess. What are you trying to accomplish? Also you posted code with no code tags, without specifying your problem and where you get it. Simply by saying it doesn't work won't get you any help | |
Re: You can have a Vector of JCheckBoxes. Write a for loop that generates them from the Vector team. Or an array of JCheckBoxes | |
Re: [QUOTE=tejasthacker;965037]can anyone please make changes and comment my code [B]if u are good at it[/B]. that will be really a great help. Thanks again[/QUOTE] [QUOTE][B]if u are good at it[/B][/QUOTE] Yes, we are good at it What does this suppose to mean? Have you any idea what you are asking. … | |
Re: Since the range of the random numbers are between 1 and 10, you can create a String array with those numbers: [CODE] String [] numbers = {"one", "two", ...}; [/CODE] Then after you get the random number use it as index at the array. You must not forget that the … | |
Re: 1/(noOfPhases + 1) = 1/(3+1) = 1/4 = 0 (int) (int)/(int + int) = int/int = int 1.0/4 = 0.25 double/int = double Get it? 1/4 = 0 1.0/4 = 0.25 So I would suggest something like this: [CODE] double s = 1.0/(noOfPhases + 1); [/CODE] | |
Re: <servlet-class>: You will put the name of the class. More specifically the name of the Servlet <url-pattern>: The url that maps to the servlet. Example: If you have link that points to that url, the code inside the servlet will be invoked. You can put that url anywhere you could … | |
Re: How do you get the responses? Are they String objects like the one in your example or are they HttpServletRequest, HttpServletResponse objects? What you said about the JSP is irrelevant. You don't need a JSP to get the response. If they were, how you think you get the request from … | |
Re: I would suggest to continue with the application and implement whatever validation you require as you progress. | |
Re: [QUOTE=manas.048;964064]I want to draw a line in swing. Please help me. Thanks.[/QUOTE] Start a new thread. Did you even bother to look the date of this thread? It is 3 years old. | |
![]() | Re: [QUOTE=AshtonHogan;963129]Hi, I'm trying to use the request.getParameter("myInputField") on Page A. The problem is that the input field "myInputField" is on Page B. Does anyone know of a way to retrieve from Page A, the value of the input field that is on Page B? Thanks, -Ash[/QUOTE] You need to submit … ![]() |
| |
Re: [QUOTE=oneat;963278]Integer.toString ?? Search somewhere, but I think that it's it.[/QUOTE] Actually [I]bernadlosini[/I] needs to convert the String from the "ageTextfield.getText" and the others to int: [ICODE] Integer.parseInt("1.0") [/ICODE] [CODE] int age = Integer.parseInt( ageTextfield.getText() ); [/CODE] | |
Re: [QUOTE=beanboy;963251] the values to array "selElts" are returned from a javascript function[/QUOTE] The selElts you define in javascript is [U]not[/U] the java array. They are not the same. What you have written doesn't work. You can [U]not[/U] call javascript method to give values to java variables. If you want to … | |
Re: [QUOTE=gunjannigam;962953]I want to create a custom NumberFormat which returns empty string for negative values and the double number iteslf for +ve and zero values. Please guide me....................[/QUOTE] Then write a method that: [CODE] if value is negative return "empty String" else return the value [/CODE] You need to explain your … | |
Re: [CODE] <a href="ProductController?linkValue=A" target="right">A</a> [/CODE] And at the servlet use the "request.getParameter" | |
Re: First of all you need to tell us what is your problem. Second, you forgot to post the ReverseString.reverseIt() method. We don't need to know how you call your method. The code you posted is correct. You call the method and you print it. What you should have posted is … | |
Re: [QUOTE=VernonDozier;945712]Well, what exactly are you sorting? What's the input and what is the output supposed to be? Is it splitting a sentence into words, then sorting the words? If so, "All Big Cats" is already sorted and "Cats All Big" would turn into "All Big Cats". What's the goal here?[/QUOTE] … | |
Re: You can put an id attribute at the label tag and access it using: document.getElementById | |
Re: I would suggest to use the split method: [CODE] String [] sentenceArray = enteredText.split(" "); [/CODE] | |
Re: If your array is an array of Strings the you can use the compareTo method: [URL="http://java.sun.com/javase/6/docs/api/java/lang/String.html#compareTo(java.lang.String)"]http://java.sun.com/javase/6/docs/api/java/lang/String.html#compareTo(java.lang.String)[/URL] [CODE] String s1 = "a"; String s2 = "b"; int i = s1.compareTo(s2); [/CODE] This method's return values represents which String is greater or lower than the other. So you can use that method … | |
Re: It is because you don't pass "realName" from update.jsp to next.jsp in the request. Maybe you can put them as hidden fields at the update.jsp. (I don't really use javabeans) [CODE] <form name="formName" action="next.jsp"> <input type="hidden" name="realName" value="the value from the bean" /> <input type="hidden" name="userName" value"the value from the … | |
Re: There is no reason to do it for jsp. What are you trying to accomplish? | |
Re: You have to be more specific. Provide code, explain how it behaves, at which cases and how would you like to behave | |
Re: First of all we need to see the code at the servlet. Second, you can have a hidden parameter in the jsp and the user clicks update to change its value: [CODE] <html><head> <script language="JavaScript"> function update() { var r=confirm("Are you sure?"); if (r==true) { document.form1.action.value='update'; document.forms[0].submit(); } else { … | |
Re: Put the code in the main methods inside separate methods and classes and learn jsp | |
Re: [QUOTE=llemes4011;956293]Hello, for the project I'm working on, I need to be able to access say, a JPanel object that was created from the execution of a Jar file, and use it inside another class outside of the Jar file. Any ideas? Thanks[/QUOTE] If you want to access any object, you … | |
Re: What you want, cannot be done. The easiest way is to turn your application into an applet since you will not make much change to the code that renders the GUI | |
Re: [CODE] Scanner inFile = new Scanner (new FileReader("grades.txt")); PrintWriter outFile = new PrintWriter ("output.txt"); [/CODE] You need to set the exact path of your files. Not just their names, but where they are in the disk. Where have you saved your files? | |
Re: [QUOTE=mizzievie;956449] The import DBManager cannot be resolved [/QUOTE] You need to import the class: [CODE] <%@ page import="package.DBManager"%> [/CODE] | |
Re: [QUOTE=coud_ren_26;956058]Can somebody show me how to create a simple two column for strings? I need a sample code. Thank you for those who will help me.[/QUOTE] Actually even if we wanted to help, what is this: [I][U]a simple two column for strings[/U][/I] I have never heard of it. What do … | |
Re: Search this forum for examples on how to use this class: BufferedWriter [CODE] BufferedWriter wr = new BufferedWriter(new FileWriter("filename")); wr.write("something"); wr.newLine(); wr.close(); [/CODE] | |
Re: Is formula a String? : [CODE] formula = "((10000.00+4000.00)*(30/100))"; [/CODE] If yes then this will not work: [CODE] double amout = Double.valueOf(formula); [/CODE] The String formula has to have a numeric value. Like "2" or "-100.345". If it has value: "((10000.00+4000.00)*(30/100))" it will not work. You need to extract the … | |
Hi here is another question: I searched the internet for information about the radio tag, and this is all I found so I put it in my code [CODE] <s:radio name="..." list="myArray" /> [/CODE] The above displays all the elements of the array with radio buttons. My problem is that … | |
Re: Is this even C++ ? What is this: <strong class="highlight">for</strong> It seems to me that you copy-pasted from the source code of a web page and by posting it like this, we get the impression that you don't even know C++ or you didn't bother to post it in a … | |
Re: I would suggest that you stop working on this servlet thing and start learning some basic java because this error is very basic and usually done by beginners. You declare the Map in one method locally and you try to access it from another method. Declare it globally or declare … | |
Re: When you open an existing file and you try to write some stuff in it, the old content is automatically deleted and overwritten by the new data. There is an option at the constructor of BufferedWriter class that allows to append the new data or overwrite the old ones. [CODE] … | |
Re: [QUOTE=shockwave_05;798475]a. The salesperson number b. The product number c. The total dollar value of that product sold that day[/QUOTE] Apparently the rows (1 to 4) will be the salesperson number. The columns (1 to 5) will be the product number And the elements of the array will be the total … | |
Re: What is the total? Are you saying that, you will have for example a loop running 50 times. Sometimes the loop will print, some times it will not: [CODE] for (int i=0;i<50;i++) { if (something) System.out.println("detected"); //5% of the times, this will be printed else System.out.println(""); //nothing printed } [/CODE] … ![]() | |
Re: And why do you need properties file for this. Why don't you try javascript? | |
Re: [QUOTE=onejavaone;951555]how many days will it take to get perfect with core java? any shortcuts?[/QUOTE] You got that response because of this: [I]how many [B]days[/B][/I] It takes YEARS, many years; there are NO shortcuts. And no one will ever be perfect in core java. What you do is learn how the … | |
Re: It depends where you declare it. You should put the declaration before the login. Also we would like to see some code if you want further assistance | |
Re: The "[ICODE]System.out.println()[/ICODE]" writes to the standard output, which in your case is the server. If you check the server you will see it written. But this: [CODE] Hello! The time is now <%= getDate() %> [/CODE] is displayed at the page/browser and the: [ICODE]<%= getDate() %>[/ICODE] is replaced by whatever … | |
Re: [QUOTE=jOhN_pRattZ;674321]hello pls help me i know that you can hepl me on how to make a program that has three equation and three unknown pls A.S.A.P[/QUOTE] Don't hijack threads. Start your own. Someone else started this thread to look for help; do you think it would be nice for people … | |
Re: [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html"]http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html[/URL] propFile.properties: [QUOTE] promptName = My Name is: name = Neo [/QUOTE] [CODE] FileInputStream inputStream = new FileInputStream("propFile.properties"); Properties prop = new Properties(); prop.load(inputStream); String s1 = prop.getProperty("promptName"); String s2 = prop.getProperty("name"); System.out.println(s1 + s2); [/CODE] | |
Re: You can have a form at Main.jsp that submits to the return.jsp. Create an input field or a hidden field at the main, and take its value at the return.jsp from the request: Main [CODE] <form action="return.jsp"> <input type="text" name="textName" /> <!-- OR --> <input type="hidden" name="hiddenName value="some Value" /> … | |
Re: Your class needs to extend the JFrame class | |
Re: First of all I don't get that problem. What type of computer are you using? (RAM, processor ?) Also I used to have JCreator, if you want to try it. Another IDE is the oracle's JDeveloper but personally, I don't like it very much | |
Re: I would suggest [I]spalax[/I] to start a new thread with your question. This thread is for answering [I]robben[/I]'s questions not yours. Should we ignore [I]robben[/I] who created this thread in order to answer your question? | |
Re: [QUOTE=sean624214;936978] You are assigned to develop a simple Java program to demonstrate the functions provided by the system. [/QUOTE] I am sorry but you are mistaken we don't go to the same school, so I am not [I]assigned[/I] nor am I required to develop that program. You are. I would … | |
Re: First of all I find it surprising that you wrote this code and still couldn't find the answer. I mean was it so difficult to add this to your code? [CODE] if (lineNo==5134) { line = br.readLine(); } else if (lineNo==5100) { line = br.readLine(); } else if (lineNo==5200) { … |
The End.