masijade 1,351 Industrious Poster Team Colleague Featured Poster

But that part of the code has nothing to do with the removing part of the method? I thought I would get an error or warning or something if I just used:

fremst = fremst.neste;
denne = fremst;

since the first line then would try to set the next first in line to a customer who doesn't exist...?

Yes it does. Since, according to the code you posted, those "copy lines" take place in an "else block". So, if fremst is null it will never make it to those "copy lines", so it can never throw an NPE. Which is why I say that either the code is not the right code or the NPE is coming from somewhere else.

Also, there is no problem, whatsoever, in setting a reference null. You get an NPE when you then attempt to use that null reference (i.e. fremst.neste throws the NPE when fremst is null, but fremst = fremst.neste works just fun when fremst is not null, but fremst.neste is null).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I thought I needed more than those lines no matter what. I've been thinking and when the program reaches the last customer, don't I need a routine that says something like:
- If first.next is null
- first = last = null
Or someting like that...? (Do I need that last-part in a singly linked line?) That's why I tried that other one.

You already have

if (fremst == null)

which should catch that immediately in the next iteration. And since this assignment takes place in the block opposite that question, the NPE should never happen there (as long as the code originally posted is what is really being used).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then it is because fremst.neste is null on the first run, which probably means that you are not "adding" items to the list correctly. It also, of course, means fremst is null in the second run and so those statements should never be executed, as they take place (as far as I can see) in the portion of the if block where fremst cannot be null, so either the code is not what you've posted here, or you are mistaken in where the NPE took place. And neither "denne" nor "sist" apply here as they are not being used here.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Where and when do you get the NPE, and "denne" is irrelevant in this instance if you are allways concerned with the first item in the list, and I have no idea what "sist" is. If it gives you an NPE immediately (i.e. on the second "run" even if there are multiple items in the list), then you are not setting neste correctly.

IOW, don't "try that instead", go back to what I suggested and post where you are getting the NPE and "when".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

deleting the first (and setting the "current") would be more like

fremst = fremst.neste;
denne = fremst;

because, otherwise, you are never changing the value of "fremst", and so, are never "deleting" anything.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is VB style. It doesn't work that way in java (that would be pass-by-reference which java is not.

you do methods like this

...
double d = SomeObject.someMethod();
...
//SomeObject someMethod method
public double someMethod() {
  return 1.0;
}
...
masijade 1,351 Industrious Poster Team Colleague Featured Poster

A bad query.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? So readLine with a counter. And? And you can't "write an Excel" with a standard filwwritier. Google "POI HSSF" and/or "Andy Khan jxl".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This looks more like your "last" assignment, upon which thisd assignment is to build, and since you confess to not knowing anything about it, I can only assume that you got this from someone else as well, and you still don't know why it's not a good idea to have someone else do your homework? It's because you don't learn anything, making the next assignment all that much harder, and, eventually, our work harder, since, eventually, we may have to work with you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Which is enough to at least get started. You wouldn't have this assignment for your homework if the class weren't far enough along to at least get most of it correct (with a little space for self-initiative), so do at least that much of it, as well as you can. No one here is going to do your homework for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, the description is fairly clear, so you don't need any help with that, so you must be having some sort of problem with your code, well, post the problem code here along with the compiler and/or exception messages and we will help you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And your question about it would be?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Start your own thread, do not hijack someone else's. Locking this thread now, as it is 6 years dead, anyhow.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And your question would be ... ?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Post the complete directory/file structure of your web-apps/<yuor-app> directory and the contents of your web.xml file.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then probably not in the "right" directory.

In tomcat, your classes are either in a package heirarchy structure under web-apps/<your-app>/WEB-INF/classes or in a heirarchy structure in jar files in web-apps/<your-app>/WEB-INF/lib and "system" resources, such as JDBC drivers and the like, are in shared/lib or common/liblib in Tomcat versions before 6 (and I think as of version 6 you can also have them web-apps/<your-app>/WEB-INF/lib, I'm not sure, however).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, if it's "web-hosting", chances are you only have "web" space. I.E. you can place pages, and probably jsps, servlets, phps, asps, etc there, as well as at least a small "download" area, but anything else is a system application and those lie outside the realm of "web-hosting". Ask your provider about any possible "equivalent" services that they may (and probably do) already provide (which also includes DB services, of course), or are willing to install and make available.

Now, as stated above, if you have a "dedicated" server, virtual or not, then do what you wish, that is much more than simple "web-hosting", so I can only assume that this is not what you have.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See i have downloaded both poi and jxl but dont know how to use them?

Uhm, they both have documentation. A "manual", per se, so RTF ...

Edit: Give it a try, and if you jast can't get then post your attempt and ask a specific question.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And, what, exactly, are your "problems"?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

c'mon please help me

The description seems pretty complete to me, so the only thing I can think that you're asking is for us to do it for you, which we won't.

Post the what you've tried and/or ask a specific question about a specific aspect of the assignment that is giving you problems.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

With a text editor and a jdk.

apegram commented: Excellent! +1
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Nope! If you only want to loop over a "sub array" the "old" for loop is better. An alternative, if it is an Object array, is to stop looping (break) at the first null object.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, when you execute the command are you providing any arguments?
i.e. java <class> <arg0> <arg1>
If not, then of course args[0] is not going to exist. You need to check the length of the args array before you blindly start indexing into it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And what is line 59 of the server class? Seeing as how there is no package statement in the posted code (you do have one, right?) I can only assume that the entire code is not posted so line 59 means less than nothing to me, and I wouldn't sit here and count lines in the first place.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There is more to that exception than just "out of bounds". It tells you exactly where it happens, it might help if you tell us that as well.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google "Andy Khan jxl" and/or "POI HSSF".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Ach! I read width, you're worried about height. No, not that the HTML does it itself. You will have to determine the "heights" beofre hand and set the row height attribute on each table row individually.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, you don't run applets "from the command line". At least not using "java", use "appletviewer".

Edit: P.S. What does this even have to do with the OP.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sorry, but at this point you need a tutor, if not a real teacher. A forum is not going to help.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sorry to break this to you, but it isn't OOP if you don't use objects.

It might help to see more code, then again, if you are creating new textfields every time you want to place a value in one, that is your problem, and judging by the name of the first method that appears to be what you are doing.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, why is there no "width" parameter in the "t2" declaration to match the one in the "t3" declaration?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes you can, you just don't want to take the time to. Rather than a cut-n-paste answer (which you'll understand less than nothing of) make sure you know the concept, as well as, the construct. Read that tutorial!

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yeah, configure one of the servers to use a port other than 8080.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No. Probably not.

Seeing the code might help.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Can you share database for this bank ?

Stop begging for code, that is not the purpose of this site. I have already closed the other zombie threads you called back to life with your begging.

If you have an actual question about your code, then start a thread and ask it, but no one here is going to just give you the code for your homework.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Ok.

BTW, that was not meant to be knock on you, or anything, so I hope you didn't take it that way. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I want to design utorrent client for my semester project in java, can anyone tell me where should i start and what are the necessary steps for this, also if any useful website and information. Thank you.

Here, try this link. Much better than Salems. That bunghole!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Actually I don't do

public class Frame extends JFrame implements ActionListener

but not for the reasons posted by you. ;-)

I try not to extend the Swing classes, at all unless I specifically need to alter their behaviour, which I almost never do. I prefer composition to extension in Swing (and many other areas). I also do not have the "component" class implement the listeners as I feel this (and the previous point) is a single class doing too many things, and as being responsible for too much. It is also (in both points) very bad in terms of MVC separation, as it will probably being doing at least a bit of all of it.

For some simple one-off "small" application, say a MineSweeper or something, go ahead and have at it, otherwise ....

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Keyword "JNI"

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well you're only including two place holders "%-10s \t %8d\n" in your format String. Don't you think you should be including more?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Did you try out my suggestions in that post? Otherwise, have fun, because for one, you have to hop that the complete command, with options to the vm, is not so long that the class name isn't even retained in the ps listing. And, if it is, you need to parse that that line and using cut, sed, awk, or something similar try to cut out the "name" and differentiate it from the vm arguments, as well as any arguments that might have been fed into it. As the number of arguments (both to the VM and the app) can, obviously, vary, there is no "surefire" way of doing this in a "non-complex" generic manner.

Then again, since you're controlling it from the script that starts it, that "xxx" from the first reply is your name, so what else do you want?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Hey Chris,
Thank you very much.
It works !! Great.

Also one more thing..
Can I print the name of running java application using shell script?

What do you mean "name"? The "name" is Java. Another thing you could do (depends on how flexible your organisation is about this), is to create links to java with different names, thereby allowing the program to run under a different "name" than java.

I.E. create a /user/java link that always points to the "current" version of java. Then create another directory such as, say, /user/jprogs. Then, in that directory create links to the java command. So, say you have an application under the project name "someApp". You do

ln -s /usr/java/jre/bin/java /user/jprogs/someApp

(assuming /usr/java points to a jdk, if it points to a jre then remove the "jre" from above").

In this way your app processes each have a distinictive name without having to redo links (except for the /usr/java link) when you upgrade your jdk/jre.

It also makes it easy to switch from one version of java to another easily. Say you upgrade your jdk. Normally, you then have to go through all your apps and make sure they are using the "new" version. Then there is a problem and you want to "downgrade" back to the old version. Now you have to go through all the apps again. With the /usr/java link, you simply have to make sure all apps are configured with that, …

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Write a method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I would assume x,y (i.e. col, row) since that is what x, y is, and how they are normally referenced. But is there some sort of standard, haven't got a clue, as it doesn't matter anyway.

If you are uncertain of a specific third-party library you're using, then use that library with a known set of data, and find out which is which.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Doesn't really matter. You can refer to it either way you want, just make sure that you do it the same everywhere in the program, and if the structure is to become "public", make sure that the "direction" is documented.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why are you using a PrintStream? You do know that a PrintStream will change the character encoding, right? Since the string created using s = "...." is UTF-8 encoded and the bytes (not chars) that you are reading from the ByteArrayOutputStream represent characters encoded with the System default encoding. Therein may lay your problem.

Try doing getBytes on your s= "....." String and compare that byte array with the byte array that backs the ByteArrayOutputStream.

Edit: P.S. I am not saying that those byte arrays will be the same, BTW. I am saying that this is one way in which you can more more finely check what the difference is. BTW getBytes also translates to the default character encoding so they probably will be the same, but then try using getBytes("UTF-8") and compare them again.

Having said all this, that "toString" should have created another UTF-8 String (I can guarantee it did), so they should still have been equals, but it is worth checking.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because you're not calling it? Because the execution block never reaches the if statement? (I am talking about the if statement, not the code block associated with.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If the "if statement is not executing", then either it is not being called or the values are not equal. Those are the only possibilites (considering the posted code).