2,777 Posted Topics

Member Avatar for DK58

[QUOTE] i am still getting an error[/QUOTE] Please post the full text of the error message or explain what the problem is.

Member Avatar for hfx642
0
158
Member Avatar for lele07060

Think about how the first program controls how many * it prints on a line. It starts at one and moves on to a max number. Now rework the logic so it starts at the max number and works done to one.

Member Avatar for NormR1
0
155
Member Avatar for SnarkysXe

Can you post the full text of the error message? The message should show what line in the source is the problem.

Member Avatar for NormR1
0
251
Member Avatar for dennysimon

Read the tutorial and API doc about how focus works: [url]http://download.oracle.com/javase/tutorial/uiswing/misc/focus.html[/url]

Member Avatar for dennysimon
0
189
Member Avatar for ali11

[QUOTE]cannot find symbol[/QUOTE] The compiler can not find the definition for the variable shown in the error message. You need to look at each error message, get the symbol that was not found, go into your code and find where it is defined. If it is not defined, you need …

Member Avatar for NormR1
-1
220
Member Avatar for Jessurider

Can you explain what "jframe in a slow motion" means? Does the frame move slowly across the console? Do the pixels of the frame come slowly into view?

Member Avatar for NormR1
0
415
Member Avatar for <HHH>

Can you explain what your problem is? Does the posted code work as you want it to? Do you get errors? If so, please post the full text of the error message.

Member Avatar for <HHH>
0
106
Member Avatar for angeriel1

[QUOTE] i can't seem to figure out where to add the description of the car [/QUOTE] Is this a GUI design problem? Does the file you posted have a description? What is the layout for the data in the file? 2 numbers on one line and text on the next. …

Member Avatar for mKorbel
0
210
Member Avatar for 54uydf

[QUOTE]I'm looking for a way to browse and select a folder,[/QUOTE] An applet with permissions could do that if you want to do it from a browser. What code would the applet talk to on the server that would be able receive a folder of files?

Member Avatar for 54uydf
0
178
Member Avatar for akingcool

[QUOTE]I am having trouble getting it to work.[/QUOTE] Please explain the problem you are having. Another (and better) approach would be to use an ArrayList to hold the lines from the file.

Member Avatar for akingcool
0
190
Member Avatar for red_ferrari007

Please edit your post, select the code and wrap it in code tags. Use the [CODE] icon above the input box. You forgot to post the full text of the error message so we could see where it occurred and what the value of the index was.

Member Avatar for NormR1
0
331
Member Avatar for shujat132

[QUOTE]all of these are giving errors and i'm not able to findout probelm.[/QUOTE] You need to post the full text of the error messages. Without them it is hard to tell you what the problem is.

Member Avatar for NormR1
0
1K
Member Avatar for ali11
Member Avatar for baseballer

You could add tests for those variables' values to the if() statement ending condition.

Member Avatar for hfx642
0
117
Member Avatar for kelvin924
Member Avatar for elkowalski

Where are the images you are trying to load? Are they in the same folder as the class file or in some other folder on your PC. Applets are NOT allowed to go to any folders on your PC. They can read files from the folder that they are loaded …

Member Avatar for NormR1
0
153
Member Avatar for dennysimon

[QUOTE],how to differentiate ,from which TextField the Event is come from[/QUOTE] Look at the contents of the ActionEvent object that is passed to the listener. It has a reference to the object that is sending the event to the listener.

Member Avatar for NormR1
0
88
Member Avatar for johnpt

[QUOTE]how can i print only the lines which are between spcific dates by using the above printed date format in JAVA.[/QUOTE] You need to write code that will find the lines with the specific dates. Start printing after finding the first date and stop when finding the last.

Member Avatar for NormR1
0
104
Member Avatar for yapaarachchi

String aLine = scannner.nextLine(); // read the next line (test with hasNext() first?) char aChar = aLine.charAt(0); // get the first character

Member Avatar for TheSomalilander
0
226
Member Avatar for soham.m17

[QUOTE]how can I move the Graphics class object [/QUOTE] Not sure what this means. The JVM creates a Graphics class object and passes it as a parameter to the paint or paintComponent class. That is where you do your drawing using that object. You can call other methods from the …

Member Avatar for soham.m17
0
4K
Member Avatar for zaxon1987

[QUOTE]My program no longer compiles.[/QUOTE] please post the full text of the error messages. Since you are using third party classes, you have provide more information.

Member Avatar for JamesCherrill
0
222
Member Avatar for roycy

Please start a new thread for your problem. This thread is almost one year old. Be sure to ask specific questions about your problem with your assignment.

Member Avatar for peter_budo
0
51
Member Avatar for Mugetsu Tensho

[QUOTE] making this loop as long as you say yes [/QUOTE] Where is the code for the loop? All I see are some if statements?

Member Avatar for Mugetsu Tensho
0
281
Member Avatar for xtinawp

[QUOTE]I open the command window and typed javac Quiz1.java. When I do this it says javac:file not found:Quiz1.java[/QUOTE] Where is the Quiz1.java file? Is it in the 'current directory'? Use the dir command to see what is in the current directory and use the cd command to change directory to …

Member Avatar for peter_budo
0
1K
Member Avatar for mrjillberth

Do you have the algorithm so you can design the code? Is the program going to have a GUI or will its interface be via the commandline or console? Do you have any specific questions?

Member Avatar for mrjillberth
0
1K
Member Avatar for mrjillberth

[CODE]"o "[/CODE] You should use a final String for defining the contents of a square. final String OMan = "o "; [CODE]else if(board[a+1][b+1].equals("o ")&&board[a][b].equals("* ")&&board[c][d].equals(" ")){[/CODE] vs [CODE]else if(board[a+1][b+1].equals(OMan)&&board[a][b].equals(SMan)&&board[c][d].equals(MTSqr)){[/CODE] Using so many hardcoded literals is a bad idea. If you mistype one the compiler will not tell you it is …

Member Avatar for mrjillberth
0
2K
Member Avatar for vaironl

Are you fighting with the layout manager? Who decides where a component is placed? I don't know if you can split the job of doing layouts.

Member Avatar for vaironl
0
323
Member Avatar for hiralarious

[QUOTE]The method [COLOR="Red"]add[/COLOR](Component) in the type Container is not applicable for the arguments (String) at HwkAssignment2Appl.<init>(HwkAssignment2Appl.java:[COLOR="red"]62[/COLOR])[/QUOTE] At line 62 in your code, you call the add method with an incorrect argument.

Member Avatar for hiralarious
0
179
Member Avatar for mfletch

Please post your code in the thread so all can view easily. Can you explain what your specific problems are?

Member Avatar for mfletch
0
232
Member Avatar for blondielox

[QUOTE]java.lang.ArrayIndexOutOfBoundsException: -1 at farmersmarket5.Produce.addProduce(Produce.java:194)[/QUOTE] Look at line 194 in the Produce program. You have used an index with a value of -1 which is not a valid value for an index. You need to test the index's value before using it to make sure it is valid.

Member Avatar for NormR1
0
187
Member Avatar for PHkiDz

For a simple gui: a text field for input, a textarea for output and a button. User enters text, presses button, output displayed in text area.

Member Avatar for JamesCherrill
0
236
Member Avatar for woomichael

[QUOTE]The errors I notice in the test packages are: [/QUOTE] Can you explain what the errors are? What happens when you compile and execute the code?

Member Avatar for Taywin
0
147
Member Avatar for sebseb678

Time to do some reading: [url]http://download.oracle.com/javase/tutorial/java/javaOO/methods.html[/url]

Member Avatar for NormR1
0
95
Member Avatar for alliswim2010
Member Avatar for NormR1

Is there an easy to use tool that OPs could use to find variable's whose class level definitions are Shadowed by local definitions of variables with the same name. I see that problem a couple of times a week. Do the standard IDEs have options that would warn about the …

Member Avatar for ~s.o.s~
0
182
Member Avatar for J-Dub

For debugging I'd start with an ordinary screen vs the FULL screen. Add some printlns so you can see where the execution flow goes and what the values of variables are as they are changed.

Member Avatar for J-Dub
0
192
Member Avatar for ilovejava

Are you asking whether your code follows your algorithm correctly? Or are you asking if your algorithm is correct? For the first question, post your algorithm so we can check your code against it. For the second, ask Google.

Member Avatar for NormR1
0
399
Member Avatar for jayyzhao

Read the API doc for the Scanner class. I assume that the keyboard variable is an instance of the Scanner class. Otherwise read the API doc for that class. [QUOTE] they don't seem to be working.[/QUOTE] Please explain.

Member Avatar for NormR1
0
62
Member Avatar for gunjannigam

Does the component with the listener have the focus? Can it get the focus? Have you clicked on the component to give it the focus before pressing any keys? Please post the code here where we can see it and not have to download it.

Member Avatar for gunjannigam
0
7K
Member Avatar for m1n1m3

There are no direct connections to memory usage in java. The JVM takes care of it. [QUOTE]How i can allocate array of classes DigitData[/QUOTE] Define the array and then in a loop, fill the array with instances of the class.

Member Avatar for NormR1
0
217
Member Avatar for aanders5

Have you worked out where the elements of the arraylist (single dim) are to go in the two dim array? For example, arraylist index on left, board indexes on right: 0 -> 0,0 1 -> 0,1 etc for all the elements in the arraylist. When you write out enough of …

Member Avatar for aanders5
0
364
Member Avatar for kweigand

[QUOTE] The code compiles, but errors out when the Enter button is pushed[/QUOTE] Please copy and paste here the full text of the error message. That will tell us what is wrong.

Member Avatar for kweigand
0
175
Member Avatar for neeraj goswami

On most Windows systems there is a blank between Program and Files. Check your settings.

Member Avatar for NormR1
0
120
Member Avatar for sohiabmaroof

Cross posted at [url]http://www.java-forums.org/awt-swing/49131-java-lang-arrayindexoutofboundsexception.html[/url]

Member Avatar for sohiabmaroof
0
2K
Member Avatar for java.util

[QUOTE]it suddenly stops at line 72-73[/QUOTE] What does "suddenly stops" means? Does the loop there never end? If so, why isn't the variable being changed that allows the code out of the loop? Add some debug printlns where the variable is supposed to be changed to determine why its value …

Member Avatar for javaAddict
0
1K
Member Avatar for sirlink99
Member Avatar for sirlink99
0
268
Member Avatar for isebas

First you need to find the algorithm to do the calculations. When you get that, you can start working on the code for the program. If you have problems getting your code to work, post the code with your questions and any error messages you get.

Member Avatar for NormR1
0
120
Member Avatar for hacknayan

Are you sure the image file is being found? The code works for me. BTW use the paintComponent method in Swing components vs paint

Member Avatar for hacknayan
0
143
Member Avatar for Java2011

Please edit your post, select the code and press the [CODE] icon above the input box to wrap code tags around your code. Unformatted code is hard to read. It looks like the writeLetter method calls itself? Is that right? That is recursion and you probably do NOT want to …

Member Avatar for NormR1
0
168
Member Avatar for alliswim2010

What are your questions about your assignment? You mention the names of several methods but do not say if you are to write them or if they are provided to you and you are to use them. Please explain.

Member Avatar for alliswim2010
0
695

The End.