Posts
 
Reputation
Joined
Last Seen
Ranked #875
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
98% Quality Score
Upvotes Received
51
Posts with Upvotes
49
Upvoting Members
29
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
12 Commented Posts
~126.54K People Reached
Favorite Tags

202 Posted Topics

Member Avatar for wilsonz91

It is significant if you have a million nodes. You won't need to traverse to the end of the list if you simply maintain a tail reference to the last node.

Member Avatar for JamesCherrill
0
2K
Member Avatar for paula12

Can you ask a more specific question? What is it you don't understand?

Member Avatar for ryantroop
0
117
Member Avatar for Xufyan

[QUOTE]Caused by: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.6.0_20\bin\FirstApplet\class.class (The system cannot find the path specified)[/QUOTE] It looks like the browser or appletviewer is looking for the applet in the wrong place. You should have the .html file and the .class file in the same directory so the browser or appletviewer can find your …

Member Avatar for _aven
0
241
Member Avatar for enuff4life

hatux, please start a new thread when you have a question of your own. This thread belongs to enuff4life concerning the original post.

Member Avatar for matthewetaft
0
711
Member Avatar for cvanithakpm

Here's an example: public class MyClass { // member variable can't be accessed directly in static method private String name; public static void main(String[] args) { // create an object to access its member variables MyClass test = new MyClass(); test.name = "any name"; // ... do some other stuff …

Member Avatar for richieking
0
130
Member Avatar for nikolaos

You can read about borders [here](http://docs.oracle.com/javase/tutorial/uiswing/components/border.html). The page starts with this comment. > "Every JComponent can have one or more borders. Borders are incredibly useful objects that, while not themselves components, know how to draw the edges of Swing components. Borders are useful not only for drawing lines and fancy …

Member Avatar for nikolaos
1
18K
Member Avatar for 9662964

You could store the user's guess in an array of characters which you initialize with '-' characters. When the user gets a letter correct, put that letter in the correct spot in the array. Then when you display the array you will have the dashes and the letters in the …

Member Avatar for ASDFSGHKL
0
290
Member Avatar for Yutxz

The problem is you are not incrementing index inside your while loop so you're always looking at the first character of the input string.

Member Avatar for JamesCherrill
0
219
Member Avatar for Lamthuy

According to [URL="http://jroller.com/mipsJava/entry/sizeof_java_objects"]this article[/URL], a Vector in Java takes 80 bytes and each Double takes 16. Unfortunately it is not possible to store a primitive type in a collection like LinkedList or HashMap. The best (most memory efficient) route, as JamesCherrill suggested, is to use an array of primitive types. …

Member Avatar for Lamthuy
0
162
Member Avatar for gingerfish

I would write a helper method, call it something like [ICODE]foundPrevious[/ICODE], that takes your array, an index, and a string. It's a boolean method that searches the array from index 0 up to the input index searching for the input string. If it finds the string at any point, it …

Member Avatar for gingerfish
0
229
Member Avatar for Kuroshi

According to [URL="http://www.ibm.com/developerworks/java/library/j-webstart/"]this document[/URL]: [QUOTE]All the files for your application must be stored in a set of JAR files, including resources such as images and sound files.[/QUOTE]

Member Avatar for Kuroshi
0
143
Member Avatar for bradyramone

This is not exactly the same as your question, but perhaps it will help? [URL="http://stackoverflow.com/questions/2150265/retrieve-an-image-stored-as-blob-on-a-mysql-db"]http://stackoverflow.com/questions/2150265/retrieve-an-image-stored-as-blob-on-a-mysql-db[/URL]

Member Avatar for kramerd
0
158
Member Avatar for banks2140
Member Avatar for Desi Boy

The first error says you are using a variable called [ICODE]average[/ICODE] which you haven't declared. The rest of the errors have to do with the [ICODE]TextIO[/ICODE] class, probably because you're missing an import statement. If you post again, please put your code inside CODE tags so it gets properly indented …

Member Avatar for kramerd
0
249
Member Avatar for sariberri

The error is probably because the call to [ICODE]nextInt[/ICODE] on line 29 does not advance the read pointer to the next line. Try moving line 28 to after line 29 and take the comment marker off. If this doesn't fix the problem, please post your student class and attach the …

Member Avatar for kramerd
0
120
Member Avatar for dem10

Not enough info to determine what the problem is. Please post your entire program.

Member Avatar for kramerd
0
108
Member Avatar for hashim11

If you have a new question, please mark this thread solved and start a new thread.

Member Avatar for quuba
0
146
Member Avatar for infinitus

What you have looks close to what you need. Just some things are a bit out of order. 1. Move line 22 to come before line 20. 2. You need more variables to keep track of your data: - 1 variable to store the total number of marks entered. I …

Member Avatar for jon.kiparsky
0
452
Member Avatar for wizuptech

Let's start with a definition of "inventory management system". What does this mean to you? Can you describe some of the features such a system would have?

Member Avatar for wizuptech
0
93
Member Avatar for natha_peepli

When I run your program I get the following output: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> [/CODE] If I change to [url]www.google.com[/url] I get the following: [CODE] <!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title><script>window.google={kEI:"Di_sTNHhLoeMeLqA1Z0B",kEXPI:"27690,27818",kCSI:{e:"27690,27818",ei:"Di_sTNHhLoeMeLqA1Z0B",expi:"27690,27818"},ml:function(){},kHL:"en",time:function(){return(new Date).getTime()},log:function(b,d, [/CODE]

Member Avatar for natha_peepli
0
176
Member Avatar for Oregand

You need two main loops for this program. The outer one runs the test inside 50 times. The inner one goes the number of times the user asks for. I would use 4 arrays with 6 elements each for this problem. The first array stores the number of dice rolls …

Member Avatar for kramerd
0
122
Member Avatar for sciprog1

I'm guessing you really mean sending an object, not a class. Is that right? An object can be serialized in a number of ways and sent through a stream. There is a serialization mechanism in Java (google it), but you can also write out the data in an object to …

Member Avatar for sciprog1
0
282
Member Avatar for Mengha

You said in your first post that Java is an ambiguous language. This is not true. Ambiguous means there is more than one way to interpret it. This is a feature of natural languages, but is very bad in programming languages. However, what Java is, is very general purpose, which …

Member Avatar for kramerd
0
6K
Member Avatar for incubus9x9

You should start by trying to read the input file. Just write a program that opens the file, reads each line and prints them out. Test this to make sure it works. Next, modify your program to create an array of ints based on the first number you read from …

Member Avatar for kramerd
0
198
Member Avatar for minimi

Here's an example of bubble sort on an array of int's copied from [URL="http://www.dreamincode.net/code/snippet513.htm"]this web page[/URL]. [CODE] private void bubbleSort(int[] unsortedArray, int length) { int temp, counter, index; for(counter=0; counter<length-1; counter++) { //Loop once for each element in the array. for(index=0; index<length-1-counter; index++) { //Once for each element, minus the …

Member Avatar for apines
0
242
Member Avatar for rowley4

If I understand your question correctly, I think what you need is a [URL="http://download.oracle.com/javase/6/docs/api/javax/swing/JScrollPane.html"]JScrollPane[/URL].

Member Avatar for quuba
0
626
Member Avatar for lse123

This can be done using a [URL="http://download.oracle.com/javase/6/docs/api/javax/swing/JComboBox.html"]JComboBox[/URL].

Member Avatar for kramerd
0
71
Member Avatar for Barnifericus

I believe it comes from the word "template", and Java also uses the term "generic", which you can google. The idea is that you want a data structure that can operate on any kind of data. So you don't want to write a Binary Tree class that only deals with …

Member Avatar for sharathg.satya
0
255
Member Avatar for Tankadin

First you need to get your menu working in a loop: On line 20 put [icode]boolean done = false;[/icode]. Then between lines 21 & 22, put [icode]while (!done) {[/icode]. Then between lines 43 & 44 put [icode]done = true;[/icode]. Then between lines 45 & 46 put another close curly brace. …

Member Avatar for Tankadin
0
5K
Member Avatar for falkor15

In your printf statement, you use %d which is used for integers, but you associate with that the variable t, which is a double. The error message is saying that %d cannot be used with a double.

Member Avatar for falkor15
0
671
Member Avatar for neo_31591

You might want to post this question in one of the database forums if you don't get an answer here.

Member Avatar for neo_31591
0
123
Member Avatar for sylvestri89

Here are the 1st 3 links that come up if you search google for "java array tutorial". (There are many more if you don't like these.) [URL="http://download.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html"]http://download.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html[/URL] [URL="http://www.tutorialhero.com/tutorial-76-java_arrays.php"]http://www.tutorialhero.com/tutorial-76-java_arrays.php[/URL] [URL="http://www.learn-java-tutorial.com/Java-Arrays.cfm"]http://www.learn-java-tutorial.com/Java-Arrays.cfm[/URL]

Member Avatar for apines
0
124
Member Avatar for fregley

[URL="http://www.daniweb.com/forums/thread80130.html"]This thread[/URL] has some info that might help.

Member Avatar for fregley
0
240
Member Avatar for sciprog1

[QUOTE]The program works well offline on my desktop.[/QUOTE] Have you tried running it locally from within the Jar file? Does that work? Can you run it using appletviewer? I don't see anything obviously wrong with your HTML. If the above tests don't shed any light, post the jar & the …

Member Avatar for sciprog1
0
99
Member Avatar for Pokenerd

When you do [icode]new Thread() {...}.start();[/icode], you are creating an unnamed class and using it right where you declare it. I understand you are asking how to call setDaemon using this syntax, but I'm not sure it's possible. So my question is, why can't you create a named class for …

Member Avatar for Pokenerd
0
143
Member Avatar for merse

This is the Java forum. Please move this post the the JavaScript forum under Web Development.

Member Avatar for peter_budo
-1
93
Member Avatar for LianaN

You need to think about this problem a bit. Imagine a counter counting the seconds. It starts at 0, then goes to 1, 2, 3, ... etc. How do you know when a minute has elapsed?

Member Avatar for apines
0
104
Member Avatar for Bonesawed

1. get_hours() method should not declare local variable _hours; should return member variable hours instead. Same for get_payrate() method. 2. You need to ask a question to get further help. What is it you don't know how to do?

Member Avatar for apines
0
231
Member Avatar for Eric Cute
Member Avatar for john410

1. I think you want an array of integers rather than doubles. 2. According to the problem definition, I think you need your array to be 51 elements long (in order to include both 0 and 50). 3. You need to initialize the array so that all the numbers are …

Member Avatar for jon.kiparsky
0
116
Member Avatar for J.Killa

[icode].length()[/icode] will give you a string's length. [icode].charAt(i)[/icode], where i is an integer will give you the individual character at position i in the string (remember that indices in Java start at 0). So in a loop that goes from 0 to length-1, you can check whether each character is …

Member Avatar for J.Killa
0
251
Member Avatar for kezkez

You can cast the result to the appropriate type: [CODE] un = (ArraySet<String>)one.union(two); [/CODE]

Member Avatar for kezkez
0
104
Member Avatar for Yutxz

For some reason your code doesn't have line numbers. Usually when you post with code tags, it numbers the lines. Anyway, you have an extra close curly brace after your 2nd constructor. Remove this - all of the code in the class needs to be within the curly braces. [CODE] …

Member Avatar for kramerd
0
122
Member Avatar for Superstar288

Here's what I understand from your post. - You have a text file with some string data and some numeric data. - The string data all comes first before the numbers - The tag [Set 1] indicates the beginning of the numbers - The tag [End Set 1] comes after …

Member Avatar for Superstar288
0
155
Member Avatar for titan5

If you write the number out as a string rather than an int, it will be in ASCII. For example: [CODE] int number = 5; String text = "" + number; [/CODE] Since writing to a file is much slower than storing data in memory, you might want to create …

Member Avatar for titan5
0
141
Member Avatar for StaticX

I don't think this code will compile. What is "deal"? It looks like your button is called press.

Member Avatar for kramerd
0
125
Member Avatar for Oregand

What apines said is correct, but if you want to use methods, you can write boolean methods that will test if the diceSum has one of the values you are interested in. For example, [CODE] private boolean playerWins(int diceSum) { return diceSum == 2 || diceSum == 3 || diceSum …

Member Avatar for Oregand
0
3K
Member Avatar for Dhruv Gairola

Do you get an error? If so, please put the text of the error message in your post. Did you create the jar or get it from someone else? If you are creating it yourself, [URL="http://www.rgagnon.com/javadetails/java-0166.html"]this article[/URL] might be useful.

Member Avatar for Dhruv Gairola
0
120
Member Avatar for 47pirates

This doesn't work on a JPanel, but you can set the enclosing window (JFrame or JDialog, etc.) to be not resizable. You work really hard getting the layout just right, and then you don't want the user messing it up by resizing the window. Just call [ICODE]setResizable(false);[/ICODE] on the enclosing …

Member Avatar for hanvyj
0
184
Member Avatar for camopaint0707

1. Please post your code inside code tags in the future. 2. A bar chart is more useful when you can see all the bars together, so I think System.out.println makes more sense than showing one bar of output at a time using JOptionPane, unless you are required to display …

Member Avatar for kramerd
0
1K

The End.