Search Results

Showing results 1 to 40 of 62
Search took 0.01 seconds.
Search: Posts Made By: Black Box
Forum: Java Dec 8th, 2007
Replies: 14
Views: 6,458
Posted By Black Box
First of all, the constructor isn't right. This is the place where you should initialize your private variables rows and colums. The 2D grid array (which, considering it's just a variable, shouldn't...
Forum: Java Dec 8th, 2007
Replies: 14
Views: 6,458
Posted By Black Box
You have two ways of doing that actually, do you want the user to give it at the startup of the program or at runtime?
I'll assume that it'll be at runtime. You can use a Scanner witch reads from...
Forum: Java Dec 6th, 2007
Replies: 4
Views: 858
Posted By Black Box
If we would have had any suggestions at any point in time, we would have surely ran out of them by now, giving them to the 1385468413696434 final year students before you asking the same question......
Forum: Java Dec 6th, 2007
Replies: 14
Views: 1,271
Posted By Black Box
This is the API, start treating it as your bible :)
Java 6 API (http://java.sun.com/javase/reference/api.jsp)
Forum: Java Dec 6th, 2007
Replies: 14
Views: 1,271
Posted By Black Box
What do you mean by previously stored icon? If it has been previously stored, you just insert it where I get my icon. As for the JToggleButtons, yes, read the API on that class.

By the way, there...
Forum: Java Dec 6th, 2007
Replies: 14
Views: 1,271
Posted By Black Box
Ok, we're not getting anywhere... I've decided to throw together some lines of code that apparently do just what you want. How convenient...

public class TestClass extends JPanel implements...
Forum: Java Dec 6th, 2007
Replies: 9
Views: 698
Posted By Black Box
Yes, that whole main thing is just another method, only a special one which Java pays attention to. You don't define methods in methods, you can call them naturally.

For example:

class MyClass...
Forum: Java Dec 6th, 2007
Replies: 11
Views: 998
Posted By Black Box
We ended up using the following:
new ImageIcon(ClassName.class.getResource("images/img.jpg"))
And it's true what you say, it all depends on context issues.
Forum: Java Dec 6th, 2007
Replies: 11
Views: 998
Posted By Black Box
Just to give the solution to everyone (we worked it out over IRC).
I think the getClass() method didn't really do what it was supposed to be doing. Instead using ClassName.class.getResource() did...
Forum: Java Dec 6th, 2007
Replies: 9
Views: 698
Posted By Black Box
I think that's right Ezzaral.
If it *is* a constructor, you don't have to include void as a return type, since it's normal behaviour for a constructor to return an object of its class.

Now onto...
Forum: Java Dec 6th, 2007
Replies: 4
Views: 1,512
Posted By Black Box
For each possible outcome, you want to print out what its percentage was. You have everything you need to calculate that. You can store the number of dice rolls in a variable (or hand to the method,...
Forum: Java Dec 6th, 2007
Replies: 14
Views: 1,271
Posted By Black Box
You realise you are handing it back to the same button right (i.e. btnA1)?
Forum: Java Dec 6th, 2007
Replies: 6
Views: 1,004
Posted By Black Box
Ok, I understand... A project like that isn't given to starters, so you must know *some* Java. Start thinking of classes that can be used and how they should interact (which class uses/delivers...
Forum: Java Dec 6th, 2007
Replies: 6
Views: 1,004
Posted By Black Box
That's nice... The only thing is, we can't do it for you. If you come up with more specifications we can guide you, because at this point, "applet for create user - student & admin" isn't saying all...
Forum: Java Dec 6th, 2007
Replies: 12
Views: 1,602
Posted By Black Box
Ok, it's still the same error as before.

try {
fileReader=new BufferedReader(new FileReader("D://dna.txt"));
}
catch (IOException e) {
System.out.println("Error: File could not be...
Forum: Java Dec 5th, 2007
Replies: 3
Views: 1,880
Posted By Black Box
It's best you start from the beginning when you want to start with GUI's. GUI building in Java is best done using Swing.
The Java website provides great tutorials which will take you from the basics...
Forum: Java Dec 5th, 2007
Replies: 2
Views: 678
Posted By Black Box
It might be easier to optimize once we know what it is that you're trying to do. We can see you're checking every item of a (10 000 x 10 000) table and replacing its value. But what is it for, why...
Forum: Java Dec 4th, 2007
Replies: 8
Solved: database or csv
Views: 1,712
Posted By Black Box
Well, the only thing you'd have to do is follow the guide really. It will take you little time to setup everything you need (including the link of the database to your program).

You can use about...
Forum: Java Dec 4th, 2007
Replies: 8
Solved: database or csv
Views: 1,712
Posted By Black Box
For those images, you can store the path to it.
Forum: Java Dec 4th, 2007
Replies: 8
Solved: database or csv
Views: 1,712
Posted By Black Box
That's a good question. For this small amount of data you can work with cvs or xml files. Setting up the database and making it work in your code will take longer that doing so for the text files.
...
Forum: Java Dec 4th, 2007
Replies: 8
Views: 7,147
Posted By Black Box
What do you mean exactly? Should I start throwing random programming topics at you? Persistence, multithreading,...
Maybe random OOP topics? Inheritance, polymorphism,...

And what do you actually...
Forum: Java Dec 4th, 2007
Replies: 4
Views: 1,372
Posted By Black Box
You just cast it. In Java a char is actually just like an int, it only depends on how you use it.


// Declaration of char c, initialized with the character 'a'.
char c = 'a';
// For int value...
Forum: Java Dec 4th, 2007
Replies: 5
Views: 795
Posted By Black Box
You have to forgive him, it's probably because you didn't bother to read the Starting Java sticky in this forum and ignored my reminding link to it...

Black Box
Forum: Java Dec 4th, 2007
Replies: 7
Views: 854
Posted By Black Box
It's a method, methods belong to objects of certain types. What is the type here? I want to help, but the name 'SlowMoveVertical' is a normal looking name that a lot of people already have used to...
Forum: Java Dec 4th, 2007
Replies: 12
Views: 1,602
Posted By Black Box
Ok, first things first... the way your code looks on this forum made my eyes hurt while trying to figure out what it does. Try to use less newline and shorter indents.

As for the error, normally...
Forum: Java Dec 4th, 2007
Replies: 6
Views: 1,182
Posted By Black Box
I can understand that you want to keep it simple, really, I think everyone wants everything to be simple. The thing is, diving head first in Swing and trying everything wrong, right and different...
Forum: Java Dec 4th, 2007
Replies: 5
Views: 12,158
Posted By Black Box
Did you really shout that loud while thinking of it to type the post?

Anyway, if you have almost finished the code, post some of it here, so we can first of all see that you really have put an...
Forum: Java Dec 4th, 2007
Replies: 6
Views: 1,182
Posted By Black Box
Ok, I'm assuming you want everything to appear in the message box. First of all, everything you give System.out.print, will be printed to your console, no matter what. The easiest way to get this...
Forum: Java Dec 4th, 2007
Replies: 6
Views: 1,182
Posted By Black Box
Ok, I'm taking a look at it, but first you should know that when you post code, you should use the code tags like so: [ code ]leave out the spaces in the tags[ /code ] and when you're using a...
Forum: Java Dec 3rd, 2007
Replies: 4
Views: 816
Posted By Black Box
Actually, that isn't the solution.

The way you say it makes it look like you have to do it right away.

However, the problem was that he declared a variable and wanted to print it out at the...
Forum: Java Dec 3rd, 2007
Replies: 8
Views: 1,256
Posted By Black Box
I've copied your code and it works perfectly. How do you have your files organized?

Like this?
-WorkerDirectory
+ Worker.java
+ HourlyWorker.java
+ SalariedWorker.java
+...
Forum: Java Dec 3rd, 2007
Replies: 5
Views: 795
Posted By Black Box
Checkout this post: link (http://www.daniweb.com/forums/thread99132.html).

Everything you'd want to know or you'll need for the next month of your learning quest is in there. :)

Black Box
Forum: Java Dec 2nd, 2007
Replies: 3
Views: 1,513
Posted By Black Box
There's also something wrong with your idea of declaring an initializing.
Variables always need to be declared before you can use them. This simply means: say what it is.
Type name;
When you do it...
Forum: C Dec 2nd, 2007
Replies: 12
Views: 2,824
Posted By Black Box
Ok, first of all, that "euhm" thing is typically Dutch (it's a habit I forgot to turn off for that one post).

Second.
> Are you proud of the code and want us to marvel at it ...
Ok, he might not...
Forum: Java Dec 2nd, 2007
Replies: 3
Views: 1,190
Posted By Black Box
No problem, welcome to DaniWeb btw. :)
If you're pretty new to Java, you might want to check out the sticky topic posted by sos at the top of this Java-forum. A lot of basic useful information which...
Forum: Java Dec 2nd, 2007
Replies: 3
Views: 1,190
Posted By Black Box
Ok, your method increment needs to increment that counter variable, which you aren't doing...

There actually isn't anything wrong with the method getValue.

Try to think about what should happen...
Forum: JavaScript / DHTML / AJAX Dec 2nd, 2007
Replies: 2
Views: 872
Posted By Black Box
For JavaScript questions you should post in the JavaScript forum, a subforum of Web Development.

Java != JavaScript.

Black Box
Forum: C Dec 2nd, 2007
Replies: 4
Views: 885
Posted By Black Box
Actually, in C 0 always stands for false, but any other number stands for true (not only 1). I'm not sure about the other way, it is possible that for this direction C automatically returns 1...
Forum: C Dec 2nd, 2007
Replies: 12
Views: 2,824
Posted By Black Box
Euhm, I think he outlined his problem well enough in the first post actually...?

However, I'm not immediately seeing a possible cause for the error.
Forum: Java Dec 2nd, 2007
Replies: 5
Views: 951
Posted By Black Box
Realising that this conflicts with a fundamental principle I fully support, I have to take back my words.

Sorry for feeding the posters' misappropriation.

Black Box
Showing results 1 to 40 of 62

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC