Forum: Java 3 Days Ago |
| Replies: 8 Views: 212 Nope all four are there, but the first one is an empty string.
And that exception comes from the second array where, I can only assume, you are trying to set the elements of a String array with... |
Forum: Java 3 Days Ago |
| Replies: 8 Views: 212 Well, now, that's what I said, isn't it? Is there something wrong with allowing the OP have a feeling of accomplishment by solving it himself? Do you feel the OP is too dense to figure it out alone... |
Forum: Java 4 Days Ago |
| Replies: 8 Views: 212 The first index of an array is 0, which means the last index of an array is one less than its length. So, knowing that, take a look at the condition in your for loop and see if can find and fix the... |
Forum: Java 4 Days Ago |
| Replies: 6 Views: 171 Do you want to "set the element to 0" or do you want to remove it. The sample code will actually remove it. If all you want to do is set it to 0, then there is no reason to "record" the index when... |
Forum: Java 6 Days Ago |
| Replies: 7 Views: 249 http://www.javaworld.com/javaworld/jw-08-2003/jw-0801-toolbox.html
http://www.javaworld.com/javaworld/jw-11-1998/jw-11-techniques.html |
Forum: Java 6 Days Ago |
| Replies: 5 Views: 234 http://java.sun.com/docs/books/tutorial/ui/features/components.html
which is part of
http://java.sun.com/docs/books/tutorial/ui/index.html
and don't forget... |
Forum: Java 6 Days Ago |
| Replies: 7 Views: 249 Well, unless you have a specific reason to extend JFrame, don't extend that either. Google "composition". |
Forum: Java 6 Days Ago |
| Replies: 7 Views: 249 Implement Runnable unless you have some specific reason for extending Thread. |
Forum: Java 11 Days Ago |
| Replies: 20 Views: 478 Then that is the compilation error. On which line does that occur.
But I can tell you, that most of the class defination of "Listed" needs to be contained within a Method and not directly under... |
Forum: Java 11 Days Ago |
| Replies: 20 Views: 478 Compile the project?
Read the manual to find out how, if you must. |
Forum: Java 11 Days Ago |
| Replies: 20 Views: 478 There is more than that. That occurs when you try to execute a project within Eclipse that hasn't been successfuly compiled yet. It would definately help to have the compilation messages. |
Forum: Java 11 Days Ago |
| Replies: 20 Views: 478 It might help to know what these nebulous "errors" are. complete error message with stack traces (where applicable), please. |
Forum: Java 13 Days Ago |
| Replies: 4 Views: 262 IMHO, not really since they are different sites (as long as you keep them all up-to-date with your progress), but many people consider even that cross-posting (I consider cross-posting to be posting... |
Forum: Java 13 Days Ago |
| Replies: 4 Views: 262 ArrayList (and this looks familiar. Did you post this same question on Sun? Yes.) |
Forum: Java 13 Days Ago |
| Replies: 5 Views: 301 Huh? An "ArrayList" doesn't do any splitting whatsoever and what you are splitting on is "$$". Are you telling me that you have a String such as
a,b,c$$d,e,f$$g,h,i
And you want to get three... |
Forum: Java 13 Days Ago |
| Replies: 5 Views: 301 List<String> list = Arrays.asList(string.split()); |
Forum: Java 18 Days Ago |
| Replies: 3 Views: 398 Nope. The real problem is that that code needs to be inside a method. You can't simply code loops and other actions as part of the class definition, but rather as method/constructor/block... |
Forum: Java 23 Days Ago |
| Replies: 6 Views: 344 Scriptlets alone are a bad idea in a JSP. If you insist on doing this "on the spot", then at least make a bean out of it. |
Forum: Java 23 Days Ago |
| Replies: 6 Views: 344 This is not the sort of thing you do from a JSP page itself. This would be something that should (if part of a webservice) be started in a thread (or a few threads) when the application starts and... |
Forum: Java 24 Days Ago |
| Replies: 5 Views: 234 So do it the same way for MySQL, just with different strings for the Driver and url. |
Forum: Java 25 Days Ago |
| Replies: 4 Views: 195 Well, what is stored in the Map is a String, you cannot simply cast a String to a List. Do you want to create a List from multiple elements in this String, or do you want to simply add this String... |
Forum: Java 25 Days Ago |
| Replies: 4 Views: 195 Seems as though it is Strings stored in the map and that the map was declared using generics.
So, why are you trying to use a String as a List?
IOW, what is in the map and what are you trying... |
Forum: Java 25 Days Ago |
| Replies: 6 Views: 344 Simply connect and catch the exception. On an exception, it is, seemingly, not running, or not running properly. Use HttpURLConnection and connect to the actual site and you can even check the... |
Forum: Java 29 Days Ago |
| Replies: 6 Views: 392 Okay? And your question is? |
Forum: Java 31 Days Ago |
| Replies: 6 Views: 204 Well, text, is also "binary". If what you're reading might contain something that is not strictly plain text, then use a BufferedInputStream (with FileInputStream), rather than reader and convert... |
Forum: Java 32 Days Ago |
| Replies: 6 Views: 204 BufferedReader, readLine, a counter, and String's split. |
Forum: Java 33 Days Ago |
| Replies: 1 Views: 184 Add a System.out.println(System.getProperty("user.dir")) in there.
Otherwise use the search function for the OS.
But, the best way is to provide the full path to the file from the beginning. ... |
Forum: Java 33 Days Ago |
| Replies: 4 Views: 295 The MySQL documentation shows you which class, at the very beginning of the page I linked to, and the tutorials (and the MySQL docs) show you how to use it. Read those.
Edit: Besides, why would... |
Forum: Java 33 Days Ago |
| Replies: 4 Views: 295 You don't load the jar, you load the Driver class and include the jar on the classpath. See the Tutorial (http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html) and the MySQL manual... |
Forum: Java Oct 28th, 2009 |
| Replies: 1 Views: 176 A bare number that starts with zero is an octal number. And octal numbers cannot include either an 8 or a 9. Remove those zeros. |
Forum: Java Oct 27th, 2009 |
| Replies: 4 Views: 286 As in JMenu?
http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html |
Forum: Java Oct 26th, 2009 |
| Replies: 6 Views: 303 By adding the xlint option shown in the warning to the javac command (how you do this with any IDE you might be using depends on the IDE, read its manual). In any case, as I said, that depended on... |
Forum: Java Oct 26th, 2009 |
| Replies: 6 Views: 303 It's because you're not using generics. Also, if you look at the compiler message it is a warning, and, in this case, I believe you could ignore it. However, since you are doing all your work with... |
Forum: Java Oct 19th, 2009 |
| Replies: 9 Views: 498 Take a close look at my previous post.
The first code block is your code, the second code block is modifications to that code. |
Forum: Java Oct 19th, 2009 |
| Replies: 9 Views: 498 Well, think about that a bit.
...
String phrase; // a string of characters
...
// Read in a string and find its length
System.out.print ("Enter a... |
Forum: Java Oct 19th, 2009 |
| Replies: 9 Views: 498 Wrap the thing from that point on in a while (!phrase.equals("quit")) { loop. |
Forum: Java Oct 17th, 2009 |
| Replies: 1 Views: 270 You are calling the ethod without any arguments, but the method is designed to take an int and a double, so give it an int and a double. |
Forum: Java Oct 16th, 2009 |
| Replies: 8 Views: 376 That information seems to encapsulate a session, so Google around a bit and find out how to maintain a session using HttpURLConnection. |
Forum: Java Oct 16th, 2009 |
| Replies: 8 Views: 376 The browser is not "resolving" anything. The site is "redirecting".
So, are you using URLConnection or HttpURLConnection? HttpURLConnection will "follow" redirects, by default, URLConnection,... |
Forum: Java Oct 16th, 2009 |
| Replies: 14 Views: 1,016 Change this
to this
public detectUSB() {
initComponents();
}
and change this |