masijade 1,351 Industrious Poster Team Colleague Featured Poster
f.getParentFile().mkdirs();

The api docs work wonders, if you actually look at them.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And your problem is ...?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you use that statement, what? The machine blows up?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You would have to place the "mdb" on a shared drive and provide the path to that shared drive/mdb.

Access is not a "remote access" capable DB. It is a file-based DB. If a machine cannot directly access the mdb file, they cannot access the Acess DB, and two people cannot access it with write access simultaneously.

Edit: If you mean that you are deploying both the app and the DB and simply want to be able to configure the "string" for the path to the url, then use a string var in that position and populate that string using Properties.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And it obviously has nothing to do with the classpath (I never said, or even hinted that it did) or you would be getting a ClassNotFoundException, of course.

See that link.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Nevermind that. See the link anyway.

See this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

call repaint and/or revalidate on the componentPane after calling setVisible.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

how can i get java to enter/type text into a textbox for me once i select it(click inside it) so the cursor is there. Also how would i get it to send the enter key or other "non-text" keys.

If you want your program to automatically insert text into its Swing/AWT/Whatever Gui then, yes, use a focuslistener then simply use setText (or, if you wish to have one character at a time appear, setText in a loop with a short sleep, just make sure you don't do that on the event thread). If you are talking about having a Java Program insert text into some other program's GUI (such as a website which it sounds like what you are asking), probably not, at least not "easily", and probably not without some sort of native library and JNI. Another possibility for entering into it's own program is to use the Robot class (that will allow it to act as though there were a person sitting there and using the GUI, not just enter text in the text field) Obviously usually only useful for "demos" and/or Games (as a second player, etc).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

2) If you're mapping custom objects, you'll want to look into hashcodes. There's a lot of talk out there about good hash codes, so there's a lot of reading to do. Have fun.

Not to forget the equals method, of course. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A repair shop. It is possible to get the BIOS updated (if that's what it is). I have no idea what it is you're actually seeing (and you seemingly don't either, not really), so let a "professional" look at it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then a format won't help as the virus resides in the BIOS. Take it to a shop.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? So boot from cd/dvd and format your drives from there. A virus can't "interfere" with that unless it's a "BIOS" virus in which case you're screwed anyway.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Go to BIOS (either F2, enter, space, F1 or something similar at the very beginning of the boot process) and make sure that the cd/dvd is the first item in the boot order.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then set your boot order properly and try again.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

boot from cd.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, something on that line is null, even if it weren't that loop would eventually lead to an indexOutOfBoundsException since your for loop condition is corked. Either strSub is null, or properties is null (kind of doubt this one as it was used before the previous loop).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

For one, your if statement should be && not ||
As it is now, if it is null it attempts to do equalsIgnoreCase on that nuill reference.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Write a proper class, not a bad hack at a serial program. IOW don't just put everything in main, and catch and handle (when possible) exceptions, don't just declare "throws Exception". The very least you should do is give out a proper error message rather than just dropping out.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use String's split method to get a String[] (which you can then use in the "enhanced" for loop) then use Integer.parse(String) to get the integer values for the switch.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why!? Why!? Why!!? I say!

Why all "beginners" absolutely feel the need to do this is just beyond me. I would think it would be much easier to simply Google "How do I deploy/distribute my Java app" and find out the proper way to do it, rather than simply assuming that an "exe" is needed.

Not only does that lock you into one platform it locks you into one version. Any improvements (including security fixes) that come with newer versions of the JRE, are, of course, blissfully ignored.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
rm `ls | egrep -v "(20110225104849|20110225104833|20110225104848)"`
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Fix your code indentation. It's no wonder I missed that while loop since I didn't bother looking at anything higher than the print statement that was on the same "level" as the print statement.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Is it "giving" "SUCCESS" or " SUCCESS" or "SUCCESS " or .... I think you get the idea. The only lines after the print that will result in an NPE are the s.equals..., and since s contained a value, seemingly, the line mesg = mesg.concat... is throwing the NPE. So, s does not match exactly "SUCCESS" or some code is missing. call "trim" on s in that equals call.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Seemingly your pwd is not what you think it is.

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

Because it is assuming that numbers that start with 0 are octal numbers. ctal numbers can only have digits from 0-7. If you only want to move files where the number is greater then 030 do

mv *[3-9][0-9].jpg *[1-9][0-9][0-9].jpg destination
rhoit commented: it was fast! +4
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Package it as a jarfile.

See this and this. As always the Tutorials nearly always help, even with this.

Nahiyan commented: Clear concept +2
masijade 1,351 Industrious Poster Team Colleague Featured Poster

While needs a boolean.

while((ch = f.read()) != -1)

Now, you look at the API docs and/or the Java IO Tutorials and tell me what that line is now doing and how it is different from yours.

Edit: And format your code!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, a lot of good it did to ask the OP those questions.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What does the method signature

public int getorder()

mean? And does the method actually fulfill that contract?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As I said, it is "generally" OO, but it doesn't even come close to the "common sense" interpretation of "pure" OO. Again, hard to do that with primitives.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

P.S. It might, in the future, help to describe "don't work" precisely, as that is the singularly most useless problem description in the world.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I am happy to pass on my knowledge (as pitious as it is), I just don't like doing other's work for them. ;-)

Edit: And I expect a bit of effort. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As I said, I had to do research, specifically on the charAt feature. It’s like a substring, and can be use to target a specific character in a string, and only that one character in the string; in this case since a variable is used it targets the character in the string based on the current value of the variable, which is based on the iteration of the for-loop.

In the first pass, the variable is equal to 0, therefore (i) is equal to
0, which points to the first character in the string. Given the input name of Jason, then (i) points to the (J) only for the myName.charAt(i) code.

Correct, charAt(0) points to the first letter (Strings are "zero-indexed", as are all arrays in Java, and a String is, essentially a char array. "zero-indexed" means the index of the first position is 0, some languages are "one-indexed").

It will then examine the myName.substring(0, i) code, and since the variable is 0, the substring method is (0, 0). Here, the static (0) should now capture the (J) and nothing else, and the variable (0) captures spaces, but it looks to me only spaces are captured for this pass. I don’t quite understand this.

Not quite, almost though. the two substring arguments are, respectively, inclusive, exclusive. That means the first argument is the actual index of the first character to be "read". The second argument is the index after the last character to be read. This means that substring(0,i) …

masijade 1,351 Industrious Poster Team Colleague Featured Poster

First, there is no "official" (perceive that as IEEE) definition of "pure" OO. Yes, generally Java is definately OO. It definately does not, however adhere to even the "generally accepted" definition "Pure" OO, however. It's kind of hard to do that when you can use primitives.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the documentation for your web container.

Edit: If it is that it is a service from some third party provider, than ask them.

Shanti C commented: thanks for your quick response. +4
masijade 1,351 Industrious Poster Team Colleague Featured Poster

You need to restart the application after loading new classfiles. This happens automatically when you deploy a war file.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay. I guess all you wanted was cut-n-paste code. Well, another user for the ignore list.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

call validate and/or repaint on the container that contains those components.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That was just a guess (although DIAERESIS is the umlaut). Upon further investigation, KeyEvent is able to retreive the character (getKeyChar), but it cannot retrieve the code (getKeyCode) which is the int that needs to be used in Robot, and everything I've searched seems to point to the unfortunate circumstance that those keys simply are not provided a KeyCode and so cannot be used by Robot. The only thing I can say is to submit a "Request For Enhancement (RFE)" (or vote for any you can find on this topic). Through Sun it was handled in the bug database, not sure how it is handled through Oracle, though.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

combine the VK_O, etc, with VK_DEAD_DIAERESIS.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then you may have declared the variable outside the loop, but you didn't initialise (i.e. define) it. IOW if you do

String bogus;
while (true) {
  if (bogus.equals("Whatever")) {
    break;
  }
}

(as a contrived example)
you will get that compiler message, whereas with

String bogus = ""; // or even null
while (true) {
  if (bogus.equals("Whatever")) {
    break;
  }
}

you won't. Do you see the difference?

masijade 1,351 Industrious Poster Team Colleague Featured Poster
myName = myName.charAt(i) + myName.substring(0, i) + myName.substring(i + 1)

I did say two calls to substring (the only thing I left out was the charAt call).

Of course it is not the most effecient process in the world, but I believe this is what your instructor was looking for. Now, study this line, and post back to me how you think it is working. See the API docs for substring (the String class, of course).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That's what the ArrayIndexOutOfBounds was. If you want your program to through a "special" exception due to the lack of command line arguments than add an if statement checking the length of the args array and throw one if it is not at least as long as you expect.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In this regard I am here to help you learn, and part of that is doing research. The ability, but more importantly the willingness, to do research is a boon to any occupation and the opposite is a hindrance.

Edit: And FYI, everything I have posted here has been relevant to the topic. That you claim it isn't is part of the problem.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You claimed to have searched already, but seemingly not properly, as you asked abut "boundaries" without ever mentioning anything that even came close to collision detection, so I gave you a term to search. You didn't want to so I did the search for you and provided you with a list of links, and you didn't like that either. And, as soon as someone here regurgitated the same principles tht were to be found in the first link you said "cool I'll try that", so the only thing I can assume is that you have neither the will, nor the wherewithal to do any research. Well, then, good luck as you'll never make it as a developer if you can't take a few words as a guide and do some research. That is at least 50% of a developers job.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because the package path has nothing to do with file location. If you want to open a file based on package path use getResource to get a URL and the new File with the toURI method of that URL. (see the API docs for those). If you are only going to be readaing, then use getResourceAsStream to get an InputStream directly. If you plan on writing to it you don't want to use that and you won't be able to jar this file into the app (and if you do plan on jarring the file into the app you have to use getReourceAsStream as it will no longer be a File, but rather an entry inside of a jarfile).

Edit: I did explicitly state full path and I also gave an explicit example.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
Exception in thread "main" java.io.FileNotFoundException: gridp.ip.txt (The system cannot find the file specified)

"gridp.ip.txt" is not the full path. The full path would be "C:/whatever/directory/the/file/is/in/gridp.ip.txt".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Type the full path to the file (use forward slants "/" not backslants "\", and yes, even on windows).

That means the file either does not exist under the path given, or it cannot be accessed (user permissions).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try the tutorials.