2,777 Posted Topics

Member Avatar for usmansajid

[QUOTE] I do not understand how to move it in front of random element[/QUOTE] Before you write code, you need to come up with an algorithm or design describing what the code will do. What do you have for a design? If you were to do it manually with a …

Member Avatar for hfx642
0
1K
Member Avatar for umair jameel

What is the formula or equation to generate the numbers in that series? When you get that, we can help you write java code to output those numbers.

Member Avatar for DJSAN10
0
151
Member Avatar for dreamslct

Have you tried adding printlns to the code to see what controls how many times it prints? Print out the values of the variables that are used to see how they change and how they relate to the output.

Member Avatar for dreamslct
1
936
Member Avatar for Razer13

Can you post your current code? Try debugging your code by creating a File object with the path to the image and printing out the File class's exists() method's value.

Member Avatar for NormR1
0
139
Member Avatar for enterpise

[QUOTE] it still has some errors[/QUOTE] Please copy the full text of the error messages and post them here.

Member Avatar for enterpise
0
156
Member Avatar for krejar

[QUOTE] my answer isn't correct[/QUOTE] Please copy and paste here the input and output from the program and explain what is wrong with the output and show what the output should be. Is your problem: you don't have the correct equation or your code is not following the equation that …

Member Avatar for krejar
0
190
Member Avatar for rahul.ch

I'd start with a simple package with a single path/symbol. Write some code, compile it and execute it to see how it works.

Member Avatar for DavidKroukamp
0
244
Member Avatar for s.w.a

[QUOTE]the output is being to give only the last value i enter[/QUOTE] Are you saying that tt only contains the last value you enter? What is a table object? What does the insertaddhop method do? Is the insertaddhop() method being called? Add a println to that method to show what …

Member Avatar for NormR1
0
149
Member Avatar for ajacintha

Look at the Apache packages for interfacing with MS word documents. It is not part of standard java.

Member Avatar for NormR1
0
420
Member Avatar for jot121

[QUOTE]It is returning this: [Ljava.lang.Integer;@addbf1[/QUOTE] That printout is from an array of Integer object's toString method. It returns the datatype and the object's hashcode. If you want to see the contents of the array, use the Arrays toString() method to format it for printing. To get a single element use …

Member Avatar for hfx642
0
136
Member Avatar for nickmi

[QUOTE]how to use an external server to update a variable.[/QUOTE] Your program could request the data from the server. Where is the variable being used?

Member Avatar for hfx642
0
210
Member Avatar for Ashenvale

Does the printf method take formatting rules that will insert ,s into numeric output? Look at the API doc and at the DecimalFormat class for example.

Member Avatar for NormR1
0
100
Member Avatar for Daigan

If one button is on top of other buttons, what happens to the buttons that are underneath?

Member Avatar for Daigan
0
125
Member Avatar for sirlink99
Member Avatar for sirlink99
0
143
Member Avatar for Warl30ck

[QUOTE]The code below always returns the arrayLength = 1, which with an already filled array it is supposed to be 5.[/QUOTE] Can you post code with the array filled as desired that compiles, executes and shows the problem? Try debugging your code by adding a println to show the value …

Member Avatar for Warl30ck
0
165
Member Avatar for behemothdave

The values you are seeing:[Ljava.lang.String;@defa1ais [Ljava.lang.String;@f5da06 are the Strings returned by the default toString method for String arrays. If you want to see the full contents of the arrays, you could use the Arrays class's toString() method to format it. If you only want to see one element from the …

Member Avatar for NormR1
0
520
Member Avatar for laklaker
Member Avatar for DavidKroukamp
0
238
Member Avatar for OVOXO

See the Random class for a way to generate random numbers. [QUOTE]a way to generate a random number for each location in the 2D array[/QUOTE] What are you asking here? Are you trying to randomly access an element in the array, or are you trying to generate a random number …

Member Avatar for dmanw100
0
121
Member Avatar for nyaneshi

Where is the exception happening? Post the full text of the error message because it has the line number. The exception says that the user entered the wrong kind of data. Your code should put the input statement within a try{}catch block to catch the exception and tell the user …

Member Avatar for NormR1
0
120
Member Avatar for sharathg.satya

Look at the constructor for the Thread class. How does it connect to the code in your run method? How would the Thread object find your code? If you don't give the Thread class an object with a run() method, it will use its own. For more info: Read the …

Member Avatar for sharathg.satya
0
2K
Member Avatar for sirlink99

The if statements seem simple enough. There are 4 calls to drawImage and then a choice of one of two calls to drawImage. Which of the drawImages is not doing what you expect? 1-4 or 5/6??

Member Avatar for sirlink99
0
112
Member Avatar for riahc3

[QUOTE]it doesn't seem to work[/QUOTE] Can you explain and show the error messages? What is "BinaryOut"?

Member Avatar for riahc3
0
184
Member Avatar for Whilliam

[QUOTE] I think the problem is, x won't retain the value..[/QUOTE] What do you mean by "won't retain"? Is some code changing the value from the one you give it to another value? What value do you give it? What value is it changed to?

Member Avatar for NormR1
0
147
Member Avatar for dennysimon

As always, check your spelling. Look in the jar file with a zip file utility and check its contents. You jar command doesn't appear to use the manifest file

Member Avatar for dennysimon
0
183
Member Avatar for eng_mary

Why do you think that class exists? Where did you see it used or recommended? Why do you need it?

Member Avatar for eng_mary
0
241
Member Avatar for wallet123

[QUOTE]cant figure out what is the error [/QUOTE] Please copy and paste here the full text of the error message. When comparing the contents of String objects you should use the equals() method not the == operator. Why is this commented out: /*if (a.equalsIgnoreCase("B"))*/

Member Avatar for wallet123
0
205
Member Avatar for jackmaverick1

Try changing around the changes you are making to each of the components where you are calling different methods on each to set this and that. When you find the right combination it will work. Anyways that's what I did to get it to work, so I'll let you go …

Member Avatar for NormR1
0
163
Member Avatar for scheppy

Have you found the null variable and determined why it is null? Add some printlns to print out the values of the variables on the line where the exception occurred.

Member Avatar for NormR1
0
227
Member Avatar for jennyb
Member Avatar for stultuske
0
119
Member Avatar for lethal.b

Why start a thread that does nothing? Start one every time you need one to carry out the task. Let it do the task and exit/end.

Member Avatar for stultuske
0
104
Member Avatar for sagarakaraavan

Please explain what you code does that is not what you want it to do. Post the output from the program and explain what is wrong with the output and show what you want the output to be. A suggestion for debugging: Do the steps one at a time and …

Member Avatar for NormR1
0
112
Member Avatar for sha11e
Member Avatar for SuchANewb
Member Avatar for 03hasnam

[QUOTE] there such thing in java that already has public holiday dates predefined[/QUOTE] Public holidays are local. It would be necessary for Java to know where the code is being executed to determine if any day was a holiday. I don't think you will find anything in Java that already …

Member Avatar for dmanw100
0
2K
Member Avatar for paranoidSandra

[QUOTE]I fail to recognize, while I create 100 records for each file,[/QUOTE] How are you keeping track of the number of records written to a file? I don't see any comments in the code describing what it is supposed to do. Some suggestions for debugging your code. Replace the hardcoded …

Member Avatar for paranoidSandra
0
155
Member Avatar for jot121

[QUOTE]tell me what I should do[/QUOTE] Basically debug your code, find the error(s) and correct them. One technique for debugging code is to add println statements that print out the values of the variables as they are changed and used. The print out will show you where the code is …

Member Avatar for stultuske
0
185
Member Avatar for Vetha

What happens? Do you get errors? If so please copy and paste the full text here. Otherwise show the programs output and explain what is wrong with it.

Member Avatar for ~s.o.s~
0
1K
Member Avatar for coding101

The String class handles all that. There must be a similar class in C++

Member Avatar for dheaven
0
238
Member Avatar for Albion1

[QUOTE]I want to move from one button to an other depending on the roll of the dice[/QUOTE] Can you explain what you mean by "move"? What is a user supposed to do when using your program? What is the program supposed to do?

Member Avatar for NormR1
0
138
Member Avatar for aproxx

[QUOTE]I would like to draw something on my panel. But I'm not able to draw anything[/QUOTE] What method is supposed to do the drawing? Is that method called with a graphics object for the JPanel that is shown in your GUI? Can you make a smaller simpler program (SSCCE) that …

Member Avatar for aproxx
0
154
Member Avatar for sirlink99

[QUOTE]How can I resolve this issue_ [/QUOTE] Can you explain the issue? What changes do you want made to the data when it is copied from the text area to the file?

Member Avatar for mKorbel
0
233
Member Avatar for gourav1

Cookies are fields in the HTTP headers. Do some searches about the HTTP protocol to see what is in the headers.

Member Avatar for gourav1
0
159
Member Avatar for Blahthing

[QUOTE]when the variable reaches 45, it ceases to do anything at all[/QUOTE] Please explain. Try debugging your code by adding printlns to show where the execution flow is going and to show the values of variables as they are changed. The print out will show you if the code is …

Member Avatar for Blahthing
0
146
Member Avatar for 03hasnam

[QUOTE]How do i extract the 6th line for multiple files[/QUOTE] Read through the first six lines and save the last line read. If the sixth line is at the same offset in all the files you could use a RandomAccessFile to read the last line without reading the preceding lines.

Member Avatar for NormR1
0
381
Member Avatar for Nordijac

Your code reads the binary(ASCII) value of the character as an int. If you want to see the int as a character you need to cast it to a char. '1' has a value of 49 Try this: System.out.println("49=" + (char)49);

Member Avatar for JamesCherrill
0
170
Member Avatar for Ratman69
Member Avatar for mehnihma

You can have the same variable refer/point to different objects over time. You can create an object with a variable and add it to the array list. Now the array list has the reference to that object. You can then create a new object with the variable. pseudo code begin …

Member Avatar for mehnihma
0
643
Member Avatar for scheppy

What happens after you create a new instance of the AnimalProfitRatioCalc class in the button listener? What do you expect to happen? Look at the first place you create an instance of AnimalProfitRatioCalc. What does that code do?

Member Avatar for scheppy
0
167
Member Avatar for dennysimon

Have you added that option for the compiler and compiled the code to have the compiler show you the statement that is causing the warning?

Member Avatar for dennysimon
0
2K
Member Avatar for Jenna1994

[QUOTE] it comes out weird [/QUOTE] Can you explain what happens and perhaps copy and paste here the programs output.

Member Avatar for Philippe.Lahaie
0
196

The End.