Search Results

Showing results 1 to 40 of 1000
Search took 0.08 seconds.
Search: Posts Made By: javaAddict
Forum: Java 2 Days Ago
Replies: 3
Views: 108
Posted By javaAddict
What java version are you using?
If you are using 1.5 for example then you can map the letters with the morse code using a hashmap:


HashMap<Character,String> map =...
Forum: JSP 2 Days Ago
Replies: 9
Views: 247
Posted By javaAddict
That's because you don't read what I say to you. You just copy paste:

I changed this:

...
<option value='CONFIG_SOURCE' <%= ("CONFIG_SOURCE".equals(choice)) ? ("selected='selected'") : ""%>...
Forum: JSP 3 Days Ago
Replies: 10
Views: 860
Posted By javaAddict
Start your own thread, be more descriptive, did you put it in the session?
Forum: JSP 3 Days Ago
Replies: 9
Views: 247
Posted By javaAddict
It is like I said. You lack the very basics and you should be ready to accept criticism:

Java is executed at the server. Then the page is generated and then send to the client pure html.
...
Forum: JSP 3 Days Ago
Replies: 5
Views: 133
Posted By javaAddict
Do you know jsp, or how to submit a request using form.
If yes then maybe you can have the button ("Add Cart") submit the form that has the items the customer has selected and after you retrieve...
Forum: JSP 3 Days Ago
Replies: 9
Views: 247
Posted By javaAddict
I usually don't work with frame and I don't have time to give it much thought right now.
But, have you tried submitting the form to the jsp that is the second frame?

I assume you have a page...
Forum: JSP 3 Days Ago
Replies: 5
Views: 133
Posted By javaAddict
Here is how:
1) Post to correct forum
2) Be more descriptive on your problem
3) Show some effort

If you are talking about a web application

4) Learn about request, session
5) Learn about...
Forum: Java 3 Days Ago
Replies: 3
Views: 442
Posted By javaAddict
Thanks for the idea. I have been wanting to create a game similar to this for fun, just to kill time, but couldn't get any smart ideas.
I will definitely build this and give it to my friends to play.
Forum: Java 4 Days Ago
Replies: 1
Views: 86
Posted By javaAddict
What is the range of the random numbers? Because you can use the Math.random.
Check the API
Forum: JSP 4 Days Ago
Replies: 9
Views: 247
Posted By javaAddict
Given this:

document.getElementbyName('myCombo').selectedValue = session.getAttribute("choice");

I simply advised you to study a little more before trying things that are out of your league....
Forum: JSP 4 Days Ago
Replies: 9
Views: 247
Posted By javaAddict
You cannot combine java and javascript that way. They are NOT the same:

document.getElementbyName('myCombo').selectedValue = '<%= session.getAttribute("choice") %>';


I see from your previous...
Forum: JSP 4 Days Ago
Replies: 4
Views: 165
Posted By javaAddict
First of all request.setAttribute is void. It doesn't return a value to put it in a string.

Secondly:



You just said that it works. Then what is the problem? You cannot just go to a page,...
Forum: JSP 4 Days Ago
Replies: 4
Views: 165
Posted By javaAddict
I can't see a problem with your page. Does the page submits? Does it go from page A to page B? Is the name of the Test.jsp correct and are the pages in the same folder?

Does onChange works? Should...
Forum: Java 4 Days Ago
Replies: 2
Views: 112
Posted By javaAddict
At the validation I believe that the seconds should until 59. For the hours you 23, 59. Why not the same for seconds.

For the extract when you multiply and then do a mod, you will get 0.

123 *...
Forum: JSP 4 Days Ago
Replies: 1
Views: 140
Posted By javaAddict
When the user logs in, do you put that user in the session?

String username;
String password;

// check the database to see if the user is valid.
if (yes) {
...
Forum: Java 4 Days Ago
Replies: 4
Views: 133
Posted By javaAddict
For the first problem the method would be:


public int calculateFactor(int a, int b) {
...
}


Inside you will do the checks described in the assignment. No explanation needed. The...
Forum: Java 4 Days Ago
Replies: 4
Views: 133
Posted By javaAddict
For the second problem. You need the largest divisor? Then why start the loop from 1 and not from the number itself:

int n; // read from input using Scanner;
int maxDivisor = 1;

for (int...
Forum: Java 4 Days Ago
Replies: 2
Views: 123
Posted By javaAddict
Well I would use a double matrix:

String [][] ARRAY = {
{"A", "B", ...},
{"B", "C", ...},
{"C", "D", ...},
....
}
Forum: Java 4 Days Ago
Replies: 4
Views: 133
Posted By javaAddict
Your first code will not compile and it is not java (elif)

The second is totally inefficient and shows no thinking at all to the real problem
Forum: JSP 5 Days Ago
Replies: 1
Views: 159
Posted By javaAddict
Why don't you use the post method?
Forum: Java 5 Days Ago
Replies: 3
Views: 137
Posted By javaAddict
Given your description (the lack of description that is), you may use a System.out.println.
Forum: JSP 7 Days Ago
Replies: 8
Views: 57,310
Posted By javaAddict
And what is the point of this post? This is a 4 year old thread which has been revived 1 year ago, with no useful information. Can someone please close this?
Forum: Java 7 Days Ago
Replies: 2
Views: 159
Posted By javaAddict
public class testAssert {
public static void main(String[] args) {
int x = 5;
int y = 7;

boolean b = x!=y;

...
Forum: JSP 7 Days Ago
Replies: 3
Views: 207
Posted By javaAddict
First of all when you have questions such as this, always search the API.

http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSession.html#isNew()
...
Forum: Java 7 Days Ago
Replies: 2
Views: 172
Posted By javaAddict
First of all you don't need to have 2 Scanner classes. One would be enough and you can call its methods as many times as you like in order to read as much input as you want.


And to VernonDozier,...
Forum: Java 7 Days Ago
Replies: 21
Views: 463
Posted By javaAddict
Actually I understood that the objective was to monitor how many times a word appeared.
I would suggest sth like this:

String word;
Vector linesAppeared;

And the size of the vector would be...
Forum: Java 7 Days Ago
Replies: 21
Views: 463
Posted By javaAddict
Vector vIf = new Vector();

....
// inside the while loop
if (line.equals("if")) {
Freq[1] = Freq[1] + 1;
vIf.add(lineCount);
}
Forum: Java 7 Days Ago
Replies: 5
Views: 160
Posted By javaAddict
Both of your posts mean nothing to us:

Do you want us to search that chaos of yours in order to find the "first curly brace"?
or do you expect us to count 424 lines?

Post relevant code where...
Forum: Java 7 Days Ago
Replies: 5
Views: 160
Posted By javaAddict
At what line you get the error and what does it say and at which class?

You probably haven't defined the actionPerformed method.
Forum: Java 7 Days Ago
Replies: 19
Views: 430
Posted By javaAddict
That question has already been answered.
This thread has 19 posts and you went and read only the first and skipped the rest?



Like I said, if you read the rest of the thread you will realize...
Forum: Java 7 Days Ago
Replies: 2
Code Snippet: Need Additional Code
Views: 189
Posted By javaAddict
Don't loop like this:

for(int row=0; row<5; row++){
for(int col=0; col<3; col++){


Always like this:

for(int row=0; row<array.length; row++){
for(int col=0; col<array[row].length; col++){
Forum: Java 7 Days Ago
Replies: 19
Views: 430
Posted By javaAddict
You know very well that this is not the way to declare variables:

int firstnumber = 1,2,3,4,5,6,7,8,9,10,11,12,13;
int secondnumber = 1,2,3,4;

If you can't fix this, don't go any further.
...
Forum: Java 7 Days Ago
Replies: 4
Views: 136
Posted By javaAddict
First it will calculate what is inside the parenthesis and return it. Then it will concatenate it with the rest:
System.out.println("(a)" + (1 + m[k]) );

// "(a)" + (1 + m[k]) --> "(a)" + (1+2)...
Forum: Java 7 Days Ago
Replies: 4
Views: 136
Posted By javaAddict
Read the comments



int m [] = { 3, 2, 5, 2 };
int k = 0;

// k has value 0 so it returns 3. THEN k is increased because the ++ is after the variable
System.out.println("(a)" + m[ k++ ];
Forum: Java 7 Days Ago
Replies: 1
Views: 105
Posted By javaAddict
If you search the net with: "ActionListener" you will receive plenty of examples:
http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html
I took an example from that page and...
Forum: Java 8 Days Ago
Replies: 1
Views: 102
Posted By javaAddict
That is done by DHTML. There are examples in the web. Just search using:
"html tabs menu"
Forum: Java 8 Days Ago
Replies: 19
Views: 430
Posted By javaAddict
The ones between the "" are strings and they will be printed they way they are. Surely you have written the Hello World program:

System.out.println("Hello World");

System.out.println("Row...
Forum: Java 8 Days Ago
Replies: 19
Views: 430
Posted By javaAddict
What do you mean by "X".
Maybe this:

number " + loops + " " + loops + " x " + num + " = " + result);
Forum: Java 8 Days Ago
Replies: 2
Views: 152
Posted By javaAddict
Be more careful!!.
You missed the postcode. Count your arguments.
Forum: Java 8 Days Ago
Replies: 21
Views: 463
Posted By javaAddict
java.util.Vector (http://java.sun.com/j2se/1.5.0/docs/api/java/util/Vector.html)

Vector<Integer> v = new Vector<Integer>();

v.add(1);
v.add(2);
v.add(3);

for (int i=0;i<v.size();i++) {
...
Showing results 1 to 40 of 1000

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC