Forum: Java 4 Days Ago |
| Replies: 8 Views: 246 After taking a closer look at the code you don't need the casting. Since you read from the file a Music object, it doesn't matter what type of music it is:
while (true) {
Music music =... |
Forum: Java 4 Days Ago |
| Replies: 8 Views: 246 Even though from your code you have figured out on your own how to use array of objects here is a small example:
Music [] array = new Music[3]; // array is an array and it is not null
// Its... |
Forum: Java 9 Days Ago |
| Replies: 4 Views: 212 You can make the method static. Like the main. |
Forum: Java 10 Days Ago |
| Replies: 7 Views: 243 After searching for examples on the net, I found this:
Assuming your file is like this:
And you run this:
RandomAccessFile raf = new RandomAccessFile("fileName","rw");
... |
Forum: Java 10 Days Ago |
| Replies: 7 Views: 243 I think that the RandomAccessFile (http://java.sun.com/j2se/1.5.0/docs/api/java/io/RandomAccessFile.html) might help you. |
Forum: Java 12 Days Ago |
| Replies: 1 Views: 154 I would have used the sleep method:
// line read:
line = readLine();
// take the time at the end of the line:
lone time = ... ;
try {
Thread.sleep(time); |
Forum: Java 13 Days Ago |
| Replies: 7 Views: 303 Because you only have ONE tempPerson object. You have the same instance of it:
tempPerson.setPerson(tempName, tempAddress, tempBirthDate);
System.out.println(tempPerson.getLastName()); //... |
Forum: Java 13 Days Ago |
| Replies: 4 Views: 201 It will work, but don't forget that each element of the iterator will have one of these:
java.util.Map.Entry (http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.Entry.html) |
Forum: Java 13 Days Ago |
| Replies: 7 Views: 260 Try run it without the .class extension:
> java Hi
Then post the error that you will get :) |
Forum: Java 13 Days Ago |
| Replies: 16 Views: 577 You need to use java.util.Date, not java.sql.Date. |
Forum: Java 16 Days Ago |
| Replies: 3 Views: 208 You aren't making any sense |
Forum: JSP 24 Days Ago |
| Replies: 9 Views: 634 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 25 Days Ago |
| Replies: 5 Views: 331 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 26 Days Ago |
| Replies: 2 Views: 163 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: Java 26 Days Ago |
| Replies: 4 Views: 252 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 26 Days Ago |
| Replies: 1 Views: 416 Why don't you use the post method? |
Forum: JSP 28 Days Ago |
| Replies: 8 Views: 58,790 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 28 Days Ago |
| Replies: 21 Views: 641 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 34 Days Ago |
| Replies: 4 Views: 245 Was the assignment given to you today? If no, then what were you doing all this time? If yes, then you have a very demanding teacher.
Does this mean that next time you will do it on your... |
Forum: DaniWeb Community Feedback Oct 25th, 2009 |
| Replies: 43 Views: 4,759 Well as VernonDozier said, shouldn't you at least be able to mention the reasons why you Up or Down voted a post, or be able to see who did it to your post? |
Forum: DaniWeb Community Feedback Oct 24th, 2009 |
| Replies: 43 Views: 4,759 So from what I understood:
The reputation system affects both the rep points as well as the voting points of the specific post,
but
The voting system affects only the voting points?
Also is it... |
Forum: Java Oct 23rd, 2009 |
| Replies: 19 Views: 1,130 I haven't look at your code but from your explanation, I assume that you create the second frame, when the button is clicked?
If yes declare the second frame as global variable and create it once.... |
Forum: Java Oct 23rd, 2009 |
| Replies: 6 Views: 267 public static float average(short [] grades) {
// calculate the average using a for loop
}
And to call it after you have your array created and entered values in it:
short [] grades =... |
Forum: Java Oct 17th, 2009 |
| Replies: 6 Views: 314 I don't think it's possible. Whenever you type something it is stored in the variable, therefor you need an if statement, but I would suggest to wait for other people responses as well in case... |
Forum: Java Oct 16th, 2009 |
| Replies: 3 Views: 316 Sorry for my double post but when you are done with your solution, there is a much smarter - but more difficult - way you can try:
String [] words = {"Alpha", "Bravo", ....};
Now when you get... |
Forum: JSP Oct 13th, 2009 |
| Replies: 1 Views: 496 Have you tried using another attribute than "disabled".
The input "text" has an attribute "readonly". Search what other attributes the checkbox has. |
Forum: Java Oct 13th, 2009 |
| Replies: 2 Views: 160 Providing private lessons is not what we do here. Check the Read Me thread with the tutorials on top of this forum, and we will answer specific questions about any errors you might get with your code |
Forum: Java Oct 12th, 2009 |
| Replies: 1 Views: 490 In case you haven't noticed we have October. Tanning is out of the question, unless you plan to use the application at the South hemisphere. |
Forum: Java Oct 8th, 2009 |
| Replies: 1 Views: 200 Usually a NullPointerException means that you are trying to use something that is null. So if you get the exception at line 63:
_file.pixels[x][iy].setValue("b");
it would mean that:... |
Forum: Java Oct 7th, 2009 |
| Replies: 19 Views: 1,130 From what I see you use a lot of "extending" that I don't think is necessary. Your code works but it could have been simpler.
First don't use the "dispose" method.
Second you need to close the... |
Forum: Java Oct 6th, 2009 |
| Replies: 4 Views: 297 I think he wants a javax.swing.* program.
What you ask is impossible because we don't know your requirements. We cannot just start writing a program that does nothing using random commands with no... |
Forum: Java Oct 6th, 2009 |
| Replies: 2 Views: 275 I believe that your problem is this:
String s1 = new String( secondLength );
....
lastName.getChars ( 0, 5, secondLength, 0 );
When you create the "s1" the "secondLength" array is empty.... |
Forum: Java Oct 2nd, 2009 |
| Replies: 9 Views: 305 for (int l = 0; l < info.length; l++){
info[l] = loadPlayerPositions.readLine();
info[0] = Players.nameOfPlayer1.toString();
info[1] =... |
Forum: Java Sep 25th, 2009 |
| Replies: 6 Views: 330 Can you see something wrong with this code:
public void setName(String appt){
setName(appt);
}
You calling the same method. When you call setName it will call setName which is... |
Forum: DaniWeb Community Feedback Sep 14th, 2009 |
| Replies: 9 Views: 1,156 I am sorry for being late to respond to this.
Firstly if you read all of the posts related to that particular question in both threads (the poster created 2 threads),
you will reach to the... |
Forum: Java Sep 4th, 2009 |
| Replies: 6 Views: 491 I don't know if it is possible to get the "My Computer" as root, but check this out:
File [] files = File.listRoots();
for (int i=0;i<files.length;i++) {
... |
Forum: Java Sep 3rd, 2009 |
| Replies: 7 Views: 392 The only bug I see is you accusing a programming language which has been around for decades, used by thousands, for your incompetence.
Just because you can't get it to work doesn't mean it has a... |
Forum: Java Sep 2nd, 2009 |
| Replies: 11 Views: 295 Yes, we are good at it
What does this suppose to mean? Have you any idea what you are asking. It's not enough that you cheated at your assignment, you have the nerve to tell us that you cheated... |
Forum: JSP Aug 31st, 2009 |
| Replies: 1 Views: 357 The selElts you define in javascript is not the java array. They are not the same. What you have written doesn't work. You can not call javascript method to give values to java variables.
If you... |
Forum: JSP Aug 24th, 2009 |
| Replies: 2 Views: 397 You need to import the class:
<%@ page import="package.DBManager"%> |