Forum: Java Dec 8th, 2007 |
| Replies: 14 Views: 2,986 Re: Java - enter string 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: 2,986 Re: Java - enter string 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: 527 Re: Project 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... |
Forum: Java Dec 6th, 2007 |
| Replies: 14 Views: 715 Re: Icon movement 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: 715 Re: Icon movement 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 is... |
Forum: Java Dec 6th, 2007 |
| Replies: 14 Views: 715 Re: Icon movement 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: 406 Re: Counter 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: 627 Re: Deloyement issue 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: 627 Re: Deloyement issue 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 the... |
Forum: Java Dec 6th, 2007 |
| Replies: 9 Views: 406 Re: Counter 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 that... |
Forum: Java Dec 6th, 2007 |
| Replies: 4 Views: 773 Re: Counting Die-Rolls, Random 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: 715 Re: Icon movement You realise you are handing it back to the same button right (i.e. btnA1)? |
Forum: Java Dec 6th, 2007 |
| Replies: 6 Views: 616 Re: want help for User-password application 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: 616 Re: want help for User-password application 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,108 Re: very basic 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: 659 Re: Warning Window 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: 375 Re: help on optimizing java code 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 Views: 951 Re: database or csv 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 Views: 951 |
Forum: Java Dec 4th, 2007 |
| Replies: 8 Views: 951 Re: database or csv 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... |
Forum: Java Dec 4th, 2007 |
| Replies: 4 Views: 1,970 Re: need java project topics 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: 697 Re: ArrayOutofBounds 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 of... |
Forum: Java Dec 4th, 2007 |
| Replies: 5 Views: 482 Re: compliler 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: 566 Re: help with java please. 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,108 Re: very basic 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 it... |
Forum: Java Dec 4th, 2007 |
| Replies: 6 Views: 760 Re: Turning my board from console to Message 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: 4,392 Re: Ball Line Game 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: 760 Re: Turning my board from console to Message 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: 760 Re: Turning my board from console to Message 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: 510 Re: very simple code 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: 772 Re: Why won't this compile? 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: 482 Re: compliler 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: 731 Re: Write the definition of a class Again 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: 1,772 Re: Reading large text file 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: 618 Re: writing a definition of a class 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: 618 Re: writing a definition of a class 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 in... |
Forum: JavaScript / DHTML / AJAX Dec 2nd, 2007 |
| Replies: 2 Views: 623 |
Forum: C Dec 2nd, 2007 |
| Replies: 4 Views: 560 Re: != opperator in a mathematical expression? 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: 1,772 Re: Reading large text file 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: 594 Re: number coordinates help 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 |