1,963 Posted Topics

Member Avatar for nicolek808

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

Member Avatar for javaAddict
0
148
Member Avatar for netbeanguy

You can have a Vector of JCheckBoxes. Write a for loop that generates them from the Vector team. Or an array of JCheckBoxes

Member Avatar for VernonDozier
0
143
Member Avatar for tejasthacker

[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. …

Member Avatar for VernonDozier
0
172
Member Avatar for latinajoyce

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 …

Member Avatar for javaAddict
0
114
Member Avatar for jooa

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]

Member Avatar for Ezzaral
0
68
Member Avatar for ishlux

<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 …

Member Avatar for javaAddict
0
65
Member Avatar for tha_ratl

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 …

Member Avatar for tha_ratl
0
156
Member Avatar for synplace

I would suggest to continue with the application and implement whatever validation you require as you progress.

Member Avatar for ~s.o.s~
0
93
Member Avatar for anti_genius

[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.

Member Avatar for javaAddict
0
147
Member Avatar for feoperro

[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 …

Member Avatar for feoperro
0
167
Member Avatar for chathuD
Member Avatar for bernadlosini

[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]

Member Avatar for javaAddict
0
170
Member Avatar for beanboy

[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 …

Member Avatar for javaAddict
0
71
Member Avatar for gunjannigam

[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 …

Member Avatar for gunjannigam
0
168
Member Avatar for gaya123

[CODE] <a href="ProductController?linkValue=A" target="right">A</a> [/CODE] And at the servlet use the "request.getParameter"

Member Avatar for gaya123
0
100
Member Avatar for loozax

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 …

Member Avatar for amitrail
0
123
Member Avatar for Nitroxxerz

[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] …

Member Avatar for amitrail
0
166
Member Avatar for hajjo

You can put an id attribute at the label tag and access it using: document.getElementById

Member Avatar for javaAddict
0
79
Member Avatar for T3Roar

I would suggest to use the split method: [CODE] String [] sentenceArray = enteredText.split(" "); [/CODE]

Member Avatar for T3Roar
0
117
Member Avatar for lightner

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 …

Member Avatar for javaAddict
0
146
Member Avatar for zhangj5

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 …

Member Avatar for zhangj5
0
318
Member Avatar for rizza_f
Member Avatar for rizza_f
0
114
Member Avatar for diasmvds

You have to be more specific. Provide code, explain how it behaves, at which cases and how would you like to behave

Member Avatar for javaAddict
0
63
Member Avatar for gaya123

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 { …

Member Avatar for javaAddict
0
74
Member Avatar for vijayflash5
Member Avatar for javaAddict
0
47
Member Avatar for llemes4011

[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 …

Member Avatar for llemes4011
0
174
Member Avatar for vijayflash5

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

Member Avatar for vijayflash5
0
56
Member Avatar for caierhui

[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?

Member Avatar for JamesCherrill
0
169
Member Avatar for mizzievie

[QUOTE=mizzievie;956449] The import DBManager cannot be resolved [/QUOTE] You need to import the class: [CODE] <%@ page import="package.DBManager"%> [/CODE]

Member Avatar for javaAddict
0
83
Member Avatar for coud_ren_26

[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 …

Member Avatar for javaAddict
0
75
Member Avatar for shanakaprabath

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]

Member Avatar for javaAddict
0
88
Member Avatar for moyphus

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 …

Member Avatar for javaAddict
0
165
Member Avatar for javaAddict

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 …

Member Avatar for sangyl
0
3K
Member Avatar for chingkoysilog

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 …

Member Avatar for javaAddict
-1
195
Member Avatar for beanboy

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 …

Member Avatar for beanboy
0
95
Member Avatar for rajachandra

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] …

Member Avatar for javaAddict
0
110
Member Avatar for shockwave_05

[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 …

Member Avatar for chingkoysilog
0
2K
Member Avatar for picass0

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] …

Member Avatar for harsh2327
0
88
Member Avatar for pandeyprashant
Member Avatar for pandeyprashant
0
206
Member Avatar for onejavaone

[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 …

Member Avatar for peter_budo
0
141
Member Avatar for beanboy

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

Member Avatar for javaAddict
0
50
Member Avatar for hajjo

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 …

Member Avatar for peter_budo
0
112
Member Avatar for mdew_47

[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 …

Member Avatar for devpiyu
0
294
Member Avatar for pandeyprashant

[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]

Member Avatar for kvprajapati
0
97
Member Avatar for moonis.ahmed

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" /> …

Member Avatar for javaAddict
0
116
Member Avatar for Iamkishan
Member Avatar for .11

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

Member Avatar for ~s.o.s~
0
165
Member Avatar for robben

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?

Member Avatar for sneaker
0
204
Member Avatar for sean624214

[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 …

Member Avatar for javaAddict
0
159
Member Avatar for spalax

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) { …

Member Avatar for spalax
0
3K

The End.