Forum: Java 10 Hours Ago |
| Replies: 5 Views: 109 You are right. I mean mellowmike provided correct solution and instead of getting positive rep, he was down voted as well.
I might get down voted too for replying to this thread, but as stated... |
Forum: Java 2 Days Ago |
| Replies: 5 Views: 408 What you ask is rather difficult. In order to know when the table has been updated, you need to add triggers to your table.
Then write a PL/SQL function that executes when the "trigger" is... |
Forum: Java 2 Days Ago |
| Replies: 2 Views: 126 Because you add it only to vector and not the JList:
gf.vf.add(file);
You added it successfully to the Vector but where is the code that adds it to list? |
Forum: Java 2 Days Ago |
| Replies: 2 Views: 175 Your brackets are all over the place. You open them and you don't close them correctly. Start over and this whatever opens close it, and write code inside it.
At the while loop you don't update... |
Forum: Java 6 Days Ago |
| Replies: 8 Views: 232 So you want us to read to you the code line by line. Do you know how methods are called? If yes, it is pretty simple: Objects are created and their methods are called.
Have you tried reading the API... |
Forum: Java 6 Days Ago |
| Replies: 5 Views: 4,253 For future reference, please have your comments in the code in English |
Forum: Java 7 Days Ago |
| Replies: 3 Views: 238 Only if ob can be cast to a String. Of course you created the JTable and know better what you put in there. Since you know what you put to each cell, cast it to the appropriate class, and act... |
Forum: Java 7 Days Ago |
| Replies: 3 Views: 238 Yes, as long as it is an integer, or it can be parsed to one. |
Forum: Java 7 Days Ago |
| Replies: 4 Views: 213 for (int i = 0; i < adj2.length; i++) {
for (int j = 0; j < adj2.length; j++) {
path += adj[i][j]*adj[j][i];
}
}
The above always returns 0. If you run the code by hand you will see... |
Forum: Java 7 Days Ago |
| Replies: 2 Views: 170 No, args[0] is not null. The array args has length 0. So the args[0] gives you the exception since there is no '0' element; the length of the array is 0.
The elements of the args will never be... |
Forum: Java 7 Days Ago |
| Replies: 1 Views: 125 public class ArithmeticOperatorImpl implements ArithmeticOperator {
....
}
public class OpIterator implements OperatorIterator {
....
} |
Forum: Java 8 Days Ago |
| Replies: 4 Views: 192 Totally wrong, not to mention that we don't give away free homework. |
Forum: Java 8 Days Ago |
| Replies: 3 Views: 211 Doesn't this give you a clue?
You are trying to convert the "None" into a number, probably with Integer.parseInt(...)
Whenever you call this: Integer.parseInt(...) you need to have a try-catch in... |
Forum: Java 8 Days Ago |
| Replies: 3 Views: 183 Assuming that the sentence is stored in a String variable, why don't you check the String API. We might find something there that could be useful.
PS. I didn't notice that this is my 1666 post! |
Forum: Java 8 Days Ago |
| Replies: 3 Views: 170 None of your codes are correct. As stated in your previous thread by me, your initial code was correct. But it seems that you followed an incorrect suggestion by another member. The new line... |
Forum: Java 9 Days Ago |
| Replies: 2 Views: 140 http://www.w3schools.com/tags/ref_urlencode.asp |
Forum: Java 9 Days Ago |
| Replies: 6 Views: 206 Then this would be correct:
for(int i = 1; i <= rows; i++)
{
for(int j = 1; j <=columns; j++) {
r = r + " _";
... |
Forum: Java 9 Days Ago |
| Replies: 16 Views: 481 I agree. I prefer to write my own gui.
Surely I also use a Gui Builder but just to quickly declare and place the elements.
But most of the times I do them on my own.
It is hard to use a gui... |
Forum: Java 9 Days Ago |
| Replies: 6 Views: 206 You couldn't be more wrong.
>>>>> Shotty, your code is correct.
And tjsail try running what you wrote and what Shotty wrote and see the difference. Don't give wrong advices without testing... |
Forum: Java 9 Days Ago |
| Replies: 2 Views: 405 You haven't described what is your problem and what have you done so far. Don't expect us to read the entire code and see what works and what doesn't.
Also you are mixing everything up.
Forget... |
Forum: Java 9 Days Ago |
| Replies: 8 Views: 320 I run your code and as you can see it outputs correctly:
public static String toString2(float [] number) {
String formatStr = ">%6d %16.2f";
String outString = "";
... |
Forum: Java 11 Days Ago |
| Replies: 2 Views: 288 Use a for loop, to loop through the ArrayList and print its elements instead of the System.out.println(row1) |
Forum: Java 11 Days Ago |
| Replies: 1 Views: 211 First of all, line will never be null so you don't need to check that. By doing this:
while (scan.hasNext()) { ...
You make sure that there is a next line in the file.
Also what java version... |
Forum: Java 11 Days Ago |
| Replies: 3 Views: 212 In your class the "s" input is the one that has the values not the Score. I mean it is the "s" that you pass as parameter, then you put values from s to Score. Why on earth are you checking the... |
Forum: Java 11 Days Ago |
| Replies: 8 Views: 320 Well I believe that it's time to show your code. And probably the error is that your array is empty, you didn't put any values in it. And if you did at some point in your program, then you are not... |
Forum: Java 11 Days Ago |
| Replies: 7 Views: 310 And one more clarification. You might already know, and I might look silly telling it to you it is very important and lots of people do that mistake:
cart[i] is not an array. cart[i] is an int.... |
Forum: Java 12 Days Ago |
| Replies: 8 Views: 320 Is the number[] an array of ints or an array of floats ?
And it would be helpful if you posted the errors that you are getting.
Your code works for me only if the array is an array of floats. I... |
Forum: Java 13 Days Ago |
| Replies: 8 Views: 320 First of all the format String must not change. It is the one the determines how the output will be formatted:
outString = String.format(outString,%6d,%16f,i,numArray[i],"\n")
//or
... |
Forum: Java 13 Days Ago |
| Replies: 8 Views: 376 First of all this:
musicArray[count] = music; count++;
Can go outside the if statements. I mean in all the ifs you do the same. It doesn't matter what type of Music it is you are still going to... |
Forum: Java 13 Days Ago |
| Replies: 1 Views: 236 From the original array count how many people there are for each personality type and have those values be in 4 variables. Use those 4 variables to create 4 arrays and then loop again in order to... |
Forum: Java 14 Days Ago |
| Replies: 2 Views: 188 You forgot to use code tags |
Forum: Java 14 Days Ago |
| Replies: 3 Views: 706 Start a new thread. Use code tags |
Forum: Java 14 Days Ago |
| Replies: 8 Views: 376 I ran this:
Music [] array = new Music[3]; // array is an array and it is not null
// Its elements are so you need to initalize them
array[0] = new RockSong();
... |
Forum: Java 14 Days Ago |
| Replies: 3 Views: 214 "need to ask the user the name of the friend you want to delete"; // use the Scanner class
String name;
"then search the list to find where that friend is" // use a for loop
int index;
"then... |
Forum: Java 14 Days Ago |
| Replies: 3 Views: 217 boolean b = true;
do {
....
//do something with the b variable
....
} while (b);
The loop will terminate when the answer is found. |
Forum: Java 14 Days Ago |
| Replies: 5 Views: 225 First of all learn the difference between PreparedStatements and Statements.
You initialize the prepareStatement with a fixed query (wrong) and then you call this:
pstmt.setString(1, Cust_Id);... |
Forum: Java 14 Days Ago |
| Replies: 2 Views: 139 Edit: Sorry for the mistake post. I didn't see the names of the posters.
Also, sheehab posting just the code will not do you any good. You need to explain what it does in general, what it is... |
Forum: Java 14 Days Ago |
| Replies: 3 Views: 214 You don't add friends here:
System.out.println("Enter a friend by their first name");
firstName = input.nextLine();
friendList.add(firstName);
... |
Forum: Java 14 Days Ago |
| Replies: 3 Views: 361 I started this post after you added your second post. The extended class seems fine. What is the problem with driver. Just instantiate it and call its methods. |
Forum: Java 14 Days Ago |
| Replies: 13 Views: 10,159 Also, the initializations usually take place inside the Constructor or during declaration:
class Main {
String s = "aaa";
public Main() {
} |