masijade 1,351 Industrious Poster Team Colleague Featured Poster

And what about the rest of the advice from my first post.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

By "Show us what you have" I, obviously, meant your code. We are not simply going to do your homework for you. We will help you correct your code, though.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sure we can, as soon as we see what you have, you tell us what compiler/error messages it is giving you, and what it is actually producing and how that differs from what it should produce.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This question has nothing to do with Swing.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

the method "substring" of String, will give you the piece of the String to "repeat". Then you simply need to put it out "nRepeated" number of times (j < nRepeated not j > nRepeated) both before and after the String.

Read the API docs for String and it's substring method and give it another try.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, what do you have and what errors are you getting?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try putting SimpleDateFormat infornt of sdf

SimpleDateFormat sdf = new SimpleDateFormat ("EEEE MMMM DD, YYYY");

Well,

1. That's already been said.
2. The OP has declared the problem solved.
3. You didn't notice that today was declared today=new date() rather than today=new Date() .

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No there isn't, because it doesn't have a name. The only thing you can do, is store the table in a Map and use the key that it is stored under as the "name". A variable is simply a way for the programmer to keep track of the reference. In the compiled program it does not exist in that form.

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

Hi

I have stored File objects in a vector. Now I which to call the methods of the file objects stored in the Vector. Unlike C++ you cannot simply refer to the vector by index e.g.
vector.getAbsolutPath() nor can you simply call vector.elementAt(i).getAbsolutePath();

If you use Generics (see my last post), yes you can.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes it will work.

The following also works (and should actually be done this way, now):

Vector<File> vector = new Vector<File>();
// populate vector
String path = vector.elementAt(i).getAbsolutePath()
PoovenM commented: Well coded :) +3
peter_budo commented: The better one wins, ;) +11
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why should we do your (home)work for you? Google for chat/networking examples/tutorials, there are plenty of them out there. The simplest type of chat is contained as a tutorial as part of the Sun tutorials networking trail.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You would have to keep your own count with a separate int variable.

Otherwise, you have to loop through the array and count the number of items that are not null.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Pay close attention to the capitalisation of "O(Kk)".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Take a look at these two lines of your code, and tell me if you see the problem.

Button OKButton = new Button("OK");
		OkButton.setLocation(200,150);
masijade 1,351 Industrious Poster Team Colleague Featured Poster

I did help you, but I am not going to do your (home)work for you. Do it yourself, I gave you a direct reference to a resource that will easily allow you to do so, if you motivate yourself enough to take advantage of it. But, as we both know, since it is not a simple copy-paste action, you won't be able to.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Did you do what I told you to? That Google search is also not about debugging. If you would take the time to at last try what is suggested, you wouldn't come of as such a lazy "do-it-for-me" @sshole. That search will find Andy Khan's JExcel API which is an API for direct excel workbook creation/manipulation. So, now, how does that not answer your question (aside from not having done it for you).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do a little searching. From that link alone, with a few clicks, you can get to all the other information needed. It's all there. Really, no one is going to do your (home)work for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You don't mask your homework attempts very well, and you don't search very well.

http://java.sun.com/products/jdbc/driverdesc.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google for "Andy Khan JExcel"

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What exactly is it you want to print? At the moment you are printing only empty lines. If you actually want to print something, don't you think you should be inserting something into those println statements?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What do you mean "cannot get it to work"?

What exactly is, or is not, happening? Are you getting compiler or error messages? If so, post them, completely.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

see the man pages for the find command.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What did you use to write your file? Because if your file were the simple text you claim it to be, you wouldn't be getting that.

Tell you what, open notepad (or vi on a unix system) and open the file with that, and see of you see the same stuff there, as you do here. I'm willing to bet you do.

Did you use Word and save it as a doc rather than a txt file?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

So what did you not understand about his post? Read the API docs for KeyListener.

Hockeyfreak889 commented: not very nice +0
Ezzaral commented: Nothing mean about repeating a suggestion the poster seemed to ignore. +12
Alex Edwards commented: Approved! =) +4
masijade 1,351 Industrious Poster Team Colleague Featured Poster

It means your script is suppossed to delete the files, but rather than actually deleting them, you will simply tar-gzip them and move them somewhere else. Essentially the "trash bin" process.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I believe the result of the paint method (i.e. the actual changing of the picture seen on the screen) doesn't occur until the paint method returns. Which means, playing the sound inside the paint method will ensure that the sound is played first.

I could be completely off-base, but I believe that is the way it is.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There is no "columns" There are tab sizes, but those only apply to the current session (also saved in preferences but only for the current user), so that doesn't help as the next person/viewer/editor won't have the same settings.

You best bet is, if your good at regex, to use search and replace to add in spaces. Even better, is to modify whatever "writes" the data to do that. Anyway, for vi, here:

http://www.cs.fsu.edu/general/vimanual.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Depends on the editor.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No, you understood it right, and that's what I thought, you wanted, from the server, to use code on the client, when the client wouldn't even have it until the server is finished, since that is when the server would deliver that code to the client.

So, how did you want to do it now?

Then again, your JSP can set the onLoad attribute of the body tag to execute the JavaScript method as soon as the page is loaded.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Not that I think it the right way to do it (and also not that I think it will work since you will probably be expecting to be able use document objects which are not going to be there) but

http://java.sun.com/javase/6/docs/technotes/guides/scripting/index.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Actually, it would be that he never told appletviewer which applet he wanted to view (although your information is good information, he never even got this far).

You need to create a very small static html page that contains a reference to your applet, then run appletviewer as follows

appletviewer <full/or/relative/path/to/html/file>

Edit: One thing from the next post is true, you do not need to create an html page, you can add the applet tag as a comment at the top of the Applet Class as well then enter that as the argument to appletviewer. That does not change the original problem though, which was that you executed appletviewer without an argument, so how was it to know which applet to run?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If so, then not correctly, or you misspelled the class or package name.

A ClassNotFoundException will only occur in one of three instances:

1. The Class is not anywhere on the CLASSPATH
2. The Class name is misspelled (which, essentially, falls back to #1)
3. The package "path" is wrong/misspelled (which also, essentially, falls back to #1)

Edit: Also, do not rely on the System CLASSPATH environment variable, containers won't use it. If running from a container, then include the library either in the common/lib or shared/lib (or equivalent depending on the server) or the WEB-INF/lib directory, or include a reference to it in the Manifest file when running from a jar (using -jar) or use the -cp command line option. (When running from an IDE, add it as an external library/jar in the project properties.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Include the driver jarfile on your classpath.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Did you compile those two exception classes before compiling the other and did you use "-cp ." on the command line?

Also, why extend RuntimeException and then declare the methods to throw those exceptions? RuntimeExceptions are unchecked excpetions, they are not suppossed to be caught (although they can be), and they are definately not meant to be declared to be thrown.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you can use instanceof you can use multiple methods. What difference does it make if you use three if statements with instanceof or three overloaded methods? None, except that the overloaed methods version is more flexible, more reliable, and less likely to cause runtime problems. But, hey, more power to you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes. Congratulations.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is JavaScript. JSP cannot affect the loaded form without a submit and reload, as it runs only on the server and the loaded page is completely on the client.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, looks as though he successfully fooled you with his homework/test question.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What does that do?

I gave you alink to the API docs and the IO Tutorial. Look it up.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

SimpleDateFormats will only format Date objects (or classes that extend Date). They won't work on your date class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

null has no type. It would have a vague type determined by whatever type the argument it was passed in as was suppossed to have. And I say vague, because it would be determinable, because the method already knows it's suppossed to be of that type.

Also, how would propose to get the type (if it had one)? The Class is the type, and since there is no way to dereference null (since it is a non-object) you can neither inspect the "class" field nor call the getClass() method (at least one of which instanceof also uses).

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

No. Write two methods. One that takes a String as an parameter, and one that takes an int as a parameter.

If you feel you must do it this way, then Google for "Java instanceof".

stephen84s commented: Yep +3
Koldsoul commented: Thank you for your help. Your idea worked using instanceof. +1
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use code tags please. And post the entire and complete compiler messages and/or exceptions you are getting.

Alex Edwards commented: So much +1 in this thread it's not even funny =P +4
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, what do you have and what error/compiler messages is it producing? We are not simply going to do it for you.

Alex Edwards commented: I never get tired of seeing counter-posts like this XP +4
stephen84s commented: Couldn't agree more with Alex :D !!! +3
masijade 1,351 Industrious Poster Team Colleague Featured Poster

try it, post it, and we will help to correct it

masijade 1,351 Industrious Poster Team Colleague Featured Poster
SELECT name, SUM(liters), SUM(amount) FROM salemast GROUP BY name ORDER BY name
peter_budo commented: GROUP BY "I approve" +10
masijade 1,351 Industrious Poster Team Colleague Featured Poster
while((line=buffRead.readLine()) != null) {
    System.out.println(count+": "+line);
    line = bufRead.readLine();
    count++;
}

You are reading two lines every pass through the while loop. Once in the condition and again in the body. The error is probably coming because the while loop condition reads the last line in the file, then you try to read another line in the body of the while loop.

Delete the readLine in the body of the while loop.