2,777 Posted Topics

Member Avatar for Buffalo101

A general comment on your coding style: Instead of chaining all those constructors and methods in one statement, break them up into separate single steps. I'm not sure what your mess of code does with creating a new DataInputStream object every time around the loop. The reason the first 'a' …

Member Avatar for Buffalo101
0
85
Member Avatar for xterradaniel

To fill a component with characters you need the size of the component and you need to get the size of the characters in pixels. See the FontMetrics class. It has many methods for getting sizes. Use the Graphics class getFontMetrics method to get the needed object.

Member Avatar for NormR1
0
206
Member Avatar for red999

See the Java Tutorial for code samples.[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 red999
0
68
Member Avatar for BboyRodimus

[QUOTE]"I get reach end of file parsing"[/QUOTE] Is that an error you get when trying to compile the program? Some times you need to add some } at the end of the program. Add one } and try compiling. Same error, then add another. etc If that doesn't work then: …

Member Avatar for NormR1
0
1K
Member Avatar for Xufyan

There are two steps in using arrays of objects: First define the array -> creates empty slots with null values Second assign values to each of the slots/elements in the array. You haven't done the second step. You need to put a Student object into the array before you can …

Member Avatar for NormR1
0
231
Member Avatar for coolhunk

What is the purpose of removing the label? Do you want all the components to shift to fill in the hole where the component has been removed? Please use code tags around posted code to make it more readable. Use icon above to right. Info here: [URL="http://www.java-forums.org/misc.php?do=bbcode#code"]http://www.java-forums.org/misc.php?do=bbcode#code[/URL] [B]Please fix your …

Member Avatar for coolhunk
0
118
Member Avatar for nix_xin

[QUOTE] how can i do the rest[/QUOTE] Please be more specific about what you want to do.

Member Avatar for Xufyan
0
176
Member Avatar for rowley4

[QUOTE] I am not getting it to work.[/QUOTE] Does it execute? Is there output? Can you copy and paste here the program's output and explain what is wrong with it?

Member Avatar for JamesCherrill
0
99
Member Avatar for Protoroll

[QUOTE]This doesn't work[/QUOTE] Please explain. Show what the code outputs now and explain what is wrong with it and show what you want it to be.

Member Avatar for NormR1
0
91
Member Avatar for Qabane

[QUOTE]Void means the method takes no arguments[/QUOTE] void means the method returns no value

Member Avatar for Akill10
0
178
Member Avatar for slvrmoon32

Ok here's a start: [CODE] class Car { }[/CODE] You'll have to fill it in a bit. Take it one step at a time. For example decide what fields it needs, define them and then add the accessor methods. Write a small test pgm to exercise it by creating it, …

Member Avatar for Beauty1304
0
226
Member Avatar for judgemental
Member Avatar for nrue

[QUOTE] I always get null when I run the program[/QUOTE] Please copy and paste here the full text of all error messages.

Member Avatar for NormR1
0
513
Member Avatar for pinkygirl

Please post your code inside of code tags.Use the icon above to right. Info here: [URL="http://www.java-forums.org/misc.php?do=bbcode#code"]http://www.java-forums.org/misc.php?do=bbcode#code[/URL] Your command line needs to include the current directory indicated by a . C:\Users\User>java -cp [COLOR="red"].;[/COLOR]quaqua.jar Account Since your class is in a package, you also need to include the package path to the …

Member Avatar for masijade
0
279
Member Avatar for frankel81

Use if statements following the logic of the statements you have in bold letters. Do you know how to write a multipart condition test in an if statement. For example: if(exp1 oper exp2) where cond1 and cond2 are boolean expressions (like: a < 4) and oper is a boolean operator …

Member Avatar for frankel81
0
641
Member Avatar for nrue

Can you ask specific questions about your problem? What do the values you labeled as output and players.txt represent? The output part has 3 lines with 2 tokens on each line, the players.txt part has 4 lines with 3 tokens on each line. What is the relationship between these two?

Member Avatar for NormR1
0
1K
Member Avatar for TheSecOrg

The class Newfile must implement the inherited abstract method. Read the API doc for that interface and make sure you have correctly coded the methods it defines.

Member Avatar for NormR1
0
137
Member Avatar for TheSecOrg
Member Avatar for samuel17

[QUOTE]wont re-execute when the wrong number is entered.[/QUOTE] What controls the re-execution of the loop? Where is the value set to allow the loop to exit? If you can't see where your logic problem is by playing computer with a piece of paper and pencil, Try adding some print outs …

Member Avatar for samuel17
0
196
Member Avatar for NewOrder

[QUOTE] it doesnt work well.[/QUOTE] Please explain what happens. For debugging: print out the String being searched for with delimiters to verify the computer is using what you expect. What is the relationship between studentName and book.studentName? [QUOTE]i have a comparator function.. in the class:[/QUOTE] Can you explain what a …

Member Avatar for JamesCherrill
0
236
Member Avatar for sergiolio

You forgot to post your code and your questions about problems you are having with your code.

Member Avatar for javaAddict
0
145
Member Avatar for vincent0625

You don't give enough information to understand what your problem is. [QUOTE]i don't know how can I do so[/QUOTE] You can't do it. As tong1 said, you can NOT put an int value in boolean array.

Member Avatar for NormR1
0
61
Member Avatar for Voldemort2

Look at the PixelGrabber class for a way to get the pixels for an image. Also look at the BufferedImage's getRGB() method

Member Avatar for Voldemort2
0
152
Member Avatar for Slowly

You could read a whole line into a String and then create a Scanner to read individual words from that String. To rewind back to the beginning of the String, create a new Scanner with that String again.

Member Avatar for Slowly
0
5K
Member Avatar for bhanu1607

Please explain what the code is doing or not doing. Try debugging the code by adding print outs to show where the execution flow is going. Please put your code in code tags. Use icon above to right. Info here also: [URL="http://www.java-forums.org/misc.php?do=bbcode#code"]http://www.java-forums.org/misc.php?do=bbcode#code[/URL]

Member Avatar for NormR1
0
153
Member Avatar for PDB1982

[QUOTE]ArrayIndexOutOfBoundsException: 5 at Duplicates.NumberCheck(Duplicates.java:32)[/QUOTE] The array referenced at line 32 of you code does NOT have 6 elements in it. How does the value of the index exceed the array size when you execute line 32? If you're not sure how the value changes, print it out each time you …

Member Avatar for PDB1982
0
92
Member Avatar for judgemental
Member Avatar for coco24

Play computer with the code. Take a piece of paper and write down the values of the variables as you mentally execute each statement. For example the first time this statement is executed: for(int count = 0; count <= 3; count++) count will have a value of 0 Add some …

Member Avatar for tong1
0
101
Member Avatar for doctorjo5

[QUOTE]But I want the output to look like this: intNum + doubleNum = sum [/QUOTE] This is too simple but here's what you are asking for: System.out.println("intNum + doubleNum = sum"); or is it this: System.out.println(intNum + " + " + doubleNum + " = " + (intNum + doubleNum)); …

Member Avatar for doctorjo5
0
160
Member Avatar for shivana69

[QUOTE]You are required [/QUOTE] Shouldn't it say: "I are required"? Do you have any specific questions about the project?

Member Avatar for NormR1
0
100
Member Avatar for pmark019
Member Avatar for NormR1
0
170
Member Avatar for New2Java2010

Try printing out the value of letterGrade after it is assigned a value to see what the computer thinks it is.

Member Avatar for NormR1
0
287
Member Avatar for klasiknonie

What java programs have you written so far? Do you know how to write a class with a main method? Start with that and add on. Also could you speak English when posting?

Member Avatar for NormR1
0
34
Member Avatar for ClaireShutt
Member Avatar for Taywin
0
102
Member Avatar for toshiro101
Member Avatar for aro_kai
Member Avatar for pavan146

Please post your code in code tags to preserve formatting and to show the real code without there being a hyperlink in the middle of it.

Member Avatar for pavan146
0
108
Member Avatar for Bhargavi V
Member Avatar for kdott

[QUOTE]i need to have something that can link a keyword with the "image". [/QUOTE] Look at the Map class or its extensions. The value could be a list of the images associated with the keyword. Is the "image" an object containing an image or is it a String?

Member Avatar for NormR1
0
164
Member Avatar for xc3ss1v3

Can you explain what your problem is with creating a window? Your current code creates one, so you know the code to use. You could create a new class that extends JFrame, create it, initialize it and set it visible.

Member Avatar for xc3ss1v3
0
158
Member Avatar for MikNoz

To help you see what is happening as you do the math, print out the values as they are generated. Think of a decimal number in these terms where di is a decimal digit value 0-9: 1000*d1 + 100*d2 + 10*d3 + d4 when you reverse this number the d1 …

Member Avatar for NormR1
0
107
Member Avatar for pennylynne

[QUOTE]Use "if" to work out what button has been pressed,[/QUOTE] Look at the Event object passed to the action listener. It has methods you can use to determine what object sent the event. Your code already has that? Can you explain what your problem is? You know how to get …

Member Avatar for JamesCherrill
0
522
Member Avatar for Wootens

[QUOTE]I'm not sure how to return the info in the class method.[/QUOTE] I don't see what method you are talking about. Line 27 is in the main method which does NOT return any values (its void) Please explain. Do you get any errors when you compile the program?

Member Avatar for Laidler
0
384
Member Avatar for jtylerboy222
Member Avatar for Kerrai

Where is the variable: scan defined? The compile can not find it. There is a variable: input that points to a Scanner object. Is that it?

Member Avatar for musikluver4
0
226
Member Avatar for croc85

Where do you want to create the source? As a disk file or as a String? A disk file could use the javac command to create the class file, the String could be compiled by a JavaCompiler object. What questions do you have about creating a java source? Why do …

Member Avatar for Darryl.Burke
0
566
Member Avatar for aliskov

Perhaps if you could get the source file for the applet,you could rewrite it to work on the new hardware.

Member Avatar for aliskov
0
151
Member Avatar for rizla777

[QUOTE] use a 2d array instead of a regular for loop[/QUOTE] Apples and oranges. An array is used to store data A loop controls execution [QUOTE]how i should go abouts displaying the buttons on the board.[/QUOTE] How does that question relate to the posted code? You'd use some layout manager …

Member Avatar for NormR1
0
128
Member Avatar for y2kshane

Try debugging your code by making the method calls separately and printing out the values or the variables as they are executed. You must not be using the methods correctly. By doing each step by itself and examining the results you will see what you are doing wrong. jtextArea1.append(source.replace("aa", "q")); …

Member Avatar for NormR1
0
174
Member Avatar for jssutton11

Break up the equation into simple binary operations and someone can show you the code. For example to multiply two variables: var1 * var2 [QUOTE] how do I represent the symbol x[/QUOTE] A variable named: x would be defined by putting a type in front of the x: <THE TYPE …

Member Avatar for NormR1
0
143

The End.