1,678 Posted Topics

Member Avatar for jackiejoe

It sounds like you are using netbeans. If you "select" the button so that it is orange, then double click it (or click on 'source'), you will see something that says jButton1ActionPerformed (or whatever the name of it is). Assuming you've already created whatever other window you want to open, …

Member Avatar for weblover
0
120
Member Avatar for cppStudent

Bound it to the size of the table using modulus. Then you won't go out of bounds on the array. hash value % table size

Member Avatar for cppStudent
0
908
Member Avatar for milgo

[url]http://www.daniweb.com/forums/announcement9-3.html[/url] And try reading that thread in addition to posting what errors you got. We're more than happy to help if we don't have to spend extra time doing things we shouldn't have to (like formatting your code and pasting it into our editor to run it and see what …

Member Avatar for BestJewSinceJC
0
165
Member Avatar for jackiejoe

"Made mine with eclipse instead of netbeans" What do you mean by that? I'd suggest you don't follow any tutorials meant to be used with netbeans if you're using Eclipse. The sun tutorials are good but if you look at all of the examples they provide, they provide the full …

Member Avatar for BestJewSinceJC
0
295
Member Avatar for BestJewSinceJC

I'm not sure what forum this fits into, if any, but the program itself is going to be written in Java (not that it matters much). My question is, what is the easiest software to use that I can create a drawing of a GUI with? The GUI I want …

Member Avatar for BestJewSinceJC
0
87
Member Avatar for luke42

Try to parse the number as a double. If an exception is thrown clear the text field and request that the user input a valid decimal number.

Member Avatar for jasimp
0
204
Member Avatar for charlie81
Member Avatar for charlie81

You have an 8x8 array. All you need to go through that is two for loops. for row one through row eight for column one through column eight{ what piece is in the current index? }

Member Avatar for BestJewSinceJC
0
79
Member Avatar for campuzcrazyness

We don't give people code, we help them learn how to do it themselves. There isn't anything constructive that can come out of you posting that code for him. And the code you posted doesn't match the assignment by a long shot anyway.

Member Avatar for kebede
0
202
Member Avatar for T'Scoopz

In general, using a for loop would shorten code like that. But since you don't have many lines of code anyway, using a for loop would not shorten it. Although it might be tricky to write in this case, so as an exercise, I'd recommend that you try it.

Member Avatar for masijade
0
104
Member Avatar for campuzcrazyness

Maybe I don't understand what a chat window is, but don't you have to connect to another machine in order to chat with someone? I don't see code involving Sockets anywhere. . ?

Member Avatar for stultuske
0
428
Member Avatar for ComputerGirl

And post your code in code tags in the future. You might want to look at the forum rules/stickies.

Member Avatar for darkagn
0
137
Member Avatar for T'Scoopz

I think it's mostly because his explanation doesn't make sense. Therefore the code doesn't make sense either. Lol.

Member Avatar for BestJewSinceJC
0
130
Member Avatar for grebnesor88

And definitely answer the question(s) Vernon posed. . what IS your experience level? What concepts do you know that he mentioned?

Member Avatar for ithelp
0
107
Member Avatar for silentspanky

You have to specify what you need help with. Frankly, nobody here wants to sort through your project description and your code to figure out why you're having trouble. If you want help you need to make the effort yourself. You should start by dividing your code into logical units …

Member Avatar for silentspanky
0
554
Member Avatar for TidusBlade

Absolute Java is a good beginner's book. It covers the concepts with simplicity and clarity, and goes in depth enough that you can explore the concepts further on your own without too much trouble.

Member Avatar for TidusBlade
0
359
Member Avatar for Caled

Static methods exist for the entire class -- although I'm not sure if this is technically correct, you can think of it as there being 'one copy' for the entire class. Static methods exist whether or not you create an Object of that class type, hence the reason why you …

Member Avatar for stultuske
-1
443
Member Avatar for cppStudent
Member Avatar for cppStudent
0
120
Member Avatar for goyofoyo

The first problem is that Java supports method overloading, meaning public void actionPerformed(ActionEvent e, pig ) is not the same as public void actionPerformed(ActionEvent e) So you should be getting an error saying that you didn't override ActionListener's actionPerformed method... ? Are you?

Member Avatar for Ezzaral
0
295
Member Avatar for nanna

In order for the actionPerformed method to be called, you need to use whateverThingItIs.addActionListener(Ghu); where Ghu is an instance of your Ghu class. So, for example, if you had a JButton called button and a Ghu called myGHU, it would have to say button.addActionListener(myGHU); . Your code is pretty hard …

Member Avatar for nanna
0
326
Member Avatar for shahab.burki

I'm pretty sure your problem is in this code segment: [CODE=Java]if(this.getFirstNode()==null) { this.setFirstNode(node); this.setLastNode(node); } else { Node temp; temp=this.getFirstNode(); while(temp.getNext()!=null){ temp=temp.getNext(); } temp.setNext(node); this.setLastNode(node); }[/CODE] Consider what happens the first time you create a Node. This code gets called, and the node sets itself as both the first and …

Member Avatar for BestJewSinceJC
0
153
Member Avatar for thijo

Also, getting standard deviation is a multi-step process, is it not? Do you think it would be worthwhile to make different methods to do the separate parts? For example, standard deviation includes finding the mean, and I would think a method that finds the mean would be reusable and logically, …

Member Avatar for BestJewSinceJC
0
98
Member Avatar for darkagn

So you're saying to create a Rectangle, for example, that does not appear at all on his GUI? Then he can set the position of this invisible rectangle and see if the user clicks there with contains?

Member Avatar for darkagn
0
173
Member Avatar for denniskhor

Are you doing bit operations to count? Create a variable called nrParagraphs and increment it, nrParagraphs = nrParagraphs + 1, each time \n\n is read in. Alternatively, you could increment it every time a tab was read in.

Member Avatar for Ezzaral
0
868
Member Avatar for peedi

^ That's a very good solution, I was just going to suggest going through the String in reverse order and printing the current character.

Member Avatar for rameshrajamani
0
5K
Member Avatar for damu

I'm not too sure what you're asking but. . do you know what Applets are? This might be irrelevant, if so, feel free to ignore me. But since you've been getting no comments. .

Member Avatar for rameshrajamani
0
139
Member Avatar for tksrules

[url]http://java.sun.com/docs/books/tutorial/uiswing/[/url] Start there. Ask any questions you may have that can't be easily answered by reading.

Member Avatar for BestJewSinceJC
0
140
Member Avatar for peedi

milesdriven = keyboard.nextInt(); I'm not exactly sure what Peter Budo is talking about (not that he's wrong, he probably thinks you were talking about a GUI). But the problem here is that you declared your variable as a double (which can hold decimals such as 32.5 etc), but you tried …

Member Avatar for BestJewSinceJC
0
3K
Member Avatar for peanutmeister

Problems: 1. In the method pieceCaptured(), you never declared the variable "i", so you cannot use it as the array index. 2. You declared the arrays "whitePiece" and "blackPiece" inside a method (originalPlaces method), so the scope of those arrays is that method (which means that those arrays cannot be …

Member Avatar for BestJewSinceJC
0
98
Member Avatar for retrob89

No one is going to sort through all of that just to give you an explanation that is quite simple anyway. One thing you could do is check to see how many usernames your program currently has, and if it's 0, then display a screen allowing the user to create …

Member Avatar for BestJewSinceJC
0
154
Member Avatar for AntMastr

To determine the size of the array: -Create a variable called size that represents the size the user wants the array to be -Ask the user what they want the size of each array to be -Initialize the arrays using the variable, size, that you created earlier. Once you get …

Member Avatar for stephen84s
0
83
Member Avatar for eD_2525

The class with the buttons has to implement ActionListener. I see that you've implemented the actionPerformed method, which is the method that's called when the button is clicked, but you also have to declare your class as VendingMachine extends JFrame [B]implements ActionListener[/B]. In addition, you have to call the addActionListener …

Member Avatar for BestJewSinceJC
0
729
Member Avatar for charlie81

That's probably because you didn't import anything. In order to use the class you have to import it. I would guess the import is "import javax.swing.*;". You put imports above your class body.

Member Avatar for charlie81
0
193
Member Avatar for Q8iEnG
Member Avatar for Q8iEnG
0
170
Member Avatar for navinlearns

Make a loop in the main class that is like while(true) { -Accept incoming connection & spawn a new thread for it } There may be a better way but when I made a program to accept 4-5 connections at once, this worked well. I'm not sure if continuously sitting …

Member Avatar for BestJewSinceJC
0
119
Member Avatar for Lilal

I'd suggest reading about what static methods and static variables are, then you might start to understand why you are getting those errors, rather than guessing what you need to remove to get rid of the error. If you're using Eclipse it can be helpful because it has a lot …

Member Avatar for BestJewSinceJC
0
109
Member Avatar for olgratefuldead

Every line starts with a String. So read it in. Then use a while loop to read in each integer on the line until -1 is the last integer you read in. Then repeat this process until you are at the end of the file.

Member Avatar for olgratefuldead
0
197
Member Avatar for countyman

If you want help, then identify, specifically, what you are trying to do and why it does not work. We aren't going to scour your program for errors and give you answers. We will help you if you specify what you need help with. Start by dividing your payscale program …

Member Avatar for countyman
0
283
Member Avatar for llemes4011

Out of curiosity, what are you using for this project (as far as GUI package)? Java 3d?

Member Avatar for llemes4011
0
112
Member Avatar for trelek2

Undoubtedly it's because you are attempting to read the file incorrectly (for example, you're using the String class' substring method, when you should be reading in a double). But you should use print statements and a catch statement to print out your exceptions/errors. ballXpos = Double.valueOf(line.substring(19)).doubleValue(); ^ doesn't work.

Member Avatar for BestJewSinceJC
0
245
Member Avatar for azket
Member Avatar for IMtheBESTatJAVA
Member Avatar for verruckt24
0
167
Member Avatar for shaselai
Member Avatar for DomoCobra

There's a way you can get around that. I think its by putting a backslash before the thing it thinks is an illegal escape character. So try \\d.

Member Avatar for sillyboy
0
79
Member Avatar for PhiberOptik

Are you trying to update a file that the program is reading from? Or are you trying to change the code of a program that is running and then run it again? (Which would seem quite difficult to me). I don't think either of these are what you're trying to …

Member Avatar for PhiberOptik
0
91
Member Avatar for jksaheta

In addition to what he said above, if at all possible, don't post your assignment explanation, just post whatever information is relevant to helping you solve your problem. If you've identified the problematic code, this means telling us what the code is supposed to be doing and telling us what …

Member Avatar for verruckt24
0
118
Member Avatar for sane83

If that is how your search engine works, all you need to do is search through each String character by character, trying to match the current substring to your current search term. If you don't know any programming languages then you shouldn't be tackling this project, you should be learning …

Member Avatar for BestJewSinceJC
0
98
Member Avatar for lucstrato

It would help if you declared main correctly, as public [B]static [/B]void Also, you might want to check that the variable 'i' doesn't go out of scope after the for loop.

Member Avatar for lucstrato
0
77
Member Avatar for jo8594
Member Avatar for sillyboy
0
132
Member Avatar for abhi_elementx

int is 32 bits so it can only hold whatever value 32 bits can hold. And since you want to know if it's positive or negative, there goes one bit that would've gone towards calculation. So calculate that and there's your limit.

Member Avatar for stephen84s
1
169

The End.