2,777 Posted Topics

Member Avatar for Mkaveli
Member Avatar for coroll
Member Avatar for jjhames

I think tong1 has forgotten how he/she learned programming. You MUST make mistakes to learn. If you copy and paste the brain doesn't get involved enough for the lessons that are needed to sink in. What you see will only be on the surface.

Member Avatar for jjhames
0
735
Member Avatar for cjmartin

Comment on using hardcoded literals in your code for testing keycodes. Why not use the self documenting VK_ symbols Or the literal '3' where you have the 51. Have you tried the consume() method?

Member Avatar for cjmartin
0
214
Member Avatar for GriffinMex

This looks like javascript. This is a java forum. You'll get better responses on a javascript forum.

Member Avatar for GriffinMex
0
174
Member Avatar for suguna07
Member Avatar for joji86

Cross posted at [URL="http://www.java-forums.org/java-applets/31125-call-c-exe-java-applet.html#post135205"]http://www.java-forums.org/java-applets/31125-call-c-exe-java-applet.html#post135205[/URL] Which forum do you want your answers on?

Member Avatar for NormR1
0
217
Member Avatar for coding101
Member Avatar for albgran
Member Avatar for NormR1
0
108
Member Avatar for shahreza

Could you explain the logic of the program again using words instead of array references? You're to compare two adjacent index entries in a table for equality. If they are the same then check if the same values for rooms are equal then add ??? something here else if the …

Member Avatar for shahreza
0
123
Member Avatar for runjel

[QUOTE]how to do that[/QUOTE] Save the times somewhere and compare them for overlaps.

Member Avatar for NormR1
0
147
Member Avatar for kyrus
Member Avatar for coroll
Member Avatar for ueoptimum

Need to see all the code around lines 9 and 13. There is a syntax error before them that is giving the compile problems.

Member Avatar for ueoptimum
0
792
Member Avatar for jemz
Member Avatar for avataralien

[QUOTE]Code Fragment[/QUOTE] It certainly is. [QUOTE]ways to update my text file existing record[/QUOTE] What do you mean by "update"? Can you explain? [QUOTE]How can I make use of scanner to complete my code[/QUOTE] Scanner methods are for [B]reading[/B] and parsing data. I don't know how you would use it to …

Member Avatar for NormR1
0
103
Member Avatar for dupowdis

YOU might have to use another class like FileFilter for no extension or override the accept() method to add your test.

Member Avatar for JamesCherrill
0
102
Member Avatar for jemimaloh
Member Avatar for wavyaquaeyes
Member Avatar for NormR1
0
187
Member Avatar for dupowdis

There are several steps to putting an app in a jar. A screwup anywhere will cause it to fail. Create a manifest file with the Main-Class: line Be careful of packages and case. Add a Class-path: line for your third party jar compile all the class files into a folder …

Member Avatar for dupowdis
0
655
Member Avatar for cjmartin

[QUOTE] display the last object in the array, multiple times.[/QUOTE] It should do it palletLocList.size() times as you have coded in the for loop. It doesn't look in the array at all. It uses the static variable's value for the class. Because you have the variables static, there is only …

Member Avatar for NormR1
0
619
Member Avatar for dylgod

To go from printing a solid diamond to only the outline, don't print the inside '*'s You need to compute when you're on the inside and output spaces instead of *s Perhaps you could use an if test.

Member Avatar for NormR1
0
94
Member Avatar for dreamweaver75

Write down on a piece of paper the information that you have. Then use algebra to compute the answer. For example: a car is moving at 20 miles/hour and will travel for 10 hours How far would the car have gone?

Member Avatar for jon.kiparsky
0
187
Member Avatar for TechLover95

Sun's has it all: [url]http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/[/url] Otherwise Google.

Member Avatar for peter_budo
0
129
Member Avatar for dylgod

Break the project down into steps. One step is to read in a non negative integer. Write a java program to do that. Compile it and execute it. Come back when you have problems. Post the full text of the error messages and the program. Now look up the formula …

Member Avatar for tong1
0
141
Member Avatar for yap_1991

Read the API doc for those classes and see what package they are in. Add import statements to your code for those packages.

Member Avatar for yap_1991
0
478
Member Avatar for drewdizzle

[QUOTE]getting an "illegal character" error [/QUOTE] Please copy and paste error text here.

Member Avatar for drewdizzle
0
214
Member Avatar for vhea

Sounds like a hardware problem not a software problem. Try asking an electrical engineer.

Member Avatar for jon.kiparsky
0
146
Member Avatar for yap_1991

Is this the same question as [URL="http://www.daniweb.com/forums/post1287683.html#post1287683"]http://www.daniweb.com/forums/post1287683.html#post1287683[/URL]?

Member Avatar for NormR1
0
113
Member Avatar for dylgod

What does the method showInputDialog used here return? Does it need to be converted to a String? The code should verify that the data entered was valid. What would your code do if the user entered: "123"? It looks like it ignores the "23" part

Member Avatar for tong1
0
112
Member Avatar for khRiztin:)

Find and read the Sun Tutorials about GUI and Swing. Here's the Tutorial: [URL="http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/"]http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/[/URL]

Member Avatar for khRiztin:)
0
786
Member Avatar for matwe
Member Avatar for tong1
0
88
Member Avatar for usiyalla

Using the Scanner methods can be tricky. Scanner does some buffering of the input and can block for some calls. Your code assumes that there is an int ready to be read. If you used a hasNext method before using the next method, you could be sure the data was …

Member Avatar for NormR1
0
1K
Member Avatar for coding101
Member Avatar for TheComputerGuy

What is the int result you want from the String: "02/14/2010"? If its a Date you need, there are classes for parsing dates. See SimpleDateFormat

Member Avatar for ~s.o.s~
0
188
Member Avatar for avataralien

Scanner methods can be tricky. The Scanner buffers input and can block waiting for input. For example if you enter: A word to the wise <PRESS ENTER> and use next() only A is read, and "word to the wise" is left in the buffer. Your next attempt to get something …

Member Avatar for avataralien
0
119
Member Avatar for Ubraxis

[QUOTE] how to call the addProperty method from the Property class[/QUOTE] Can you explain a bit more? The addProperty method is in the Property class. There shouldn't be any problem calling it from the Property class. Can you explain what the app is supposed to do? What is the addProperty() …

Member Avatar for Ubraxis
0
101
Member Avatar for aryanarora

Java has methods not functions. What java class is the delay() method in?

Member Avatar for tong1
0
75
Member Avatar for tong1

[QUOTE]Is there other method[/QUOTE] Yes, probably hundreds. You method is a bit more than is needed. It could depend on your app's requirements [CODE] String[] input = {"a", "-1", "3"}; for (int i=0; i < input.length; i++) { try{ int val = Integer.parseInt(input[i]); if (val < 1) System.out.println("not positive integer: …

Member Avatar for NormR1
0
129
Member Avatar for shahreza

[QUOTE]problem to read empty data [/QUOTE] Can you define what "empty data" is? Is the data file in text? Is there a newline character at the end of every line? Would an empty line be one with no data between two newline characters? Your posted example does NOT show where …

Member Avatar for shahreza
0
197
Member Avatar for jk_bscomp

When I was experimenting with Ubuntu, I found many answers to my questions about how to setup java on Ubuntu on the Ubuntu forum: [URL="http://ubuntuforums.org/index.php"]http://ubuntuforums.org/index.php[/URL]

Member Avatar for stephen84s
0
266
Member Avatar for rakesh07
Member Avatar for jon.kiparsky
0
111
Member Avatar for prash.study
Member Avatar for P00dle

This works for me: [CODE] File fromFile = new File("FromFolder\\MoveMe.txt"); File toFile = new File("ToFolder\\MoveMe.txt"); System.out.println("renameTo = " + fromFile.renameTo(toFile)); // renameTo = true [/CODE] What else could be wrong?

Member Avatar for P00dle
0
332
Member Avatar for sukritiboo11

Show us the coding problems you are having. Or write a test program that uses the Scanner class and experiment with its various methods. Or read the API doc

Member Avatar for kishore sy
-1
66
Member Avatar for angellove40

Where does the NullPointerException occur? Look at that line in the source and see what variable could be null. Then figure out why that variable is null.

Member Avatar for NormR1
0
216
Member Avatar for kefeir

YOU need to show the results and explain why its not what you want. celsiusTemp=(fahrenheitTemp-32)*5/9; Common problem here is integer arithmetic. Remember 19/10 = 1

Member Avatar for NormR1
0
252
Member Avatar for hazeeel

There are classes for writing jar files. See JarOutputStream for example. Try google for sample code.

Member Avatar for NormR1
0
156
Member Avatar for P00dle

There is a lot more logic in your code than is needed for testing. The following code worked for me. It moved the file from one directory to the other: [CODE]public class MovingFile { public static void main(String[] args) { File fromFile = new File("FromFolder\\MoveMe.txt"); File toFile = new File("ToFolder\\MoveMe.txt"); …

Member Avatar for P00dle
0
256
Member Avatar for raghujosh

The End.