2,777 Posted Topics

Member Avatar for magnetic rifle

See the Math random() method and the Random class. Both will generate random numbers

Member Avatar for sirlink99
0
84
Member Avatar for ARaza110

Please edit your code and wrap it in code tags to preserve the formatting. Unformated code is hard to read I suspect the codes are connect by their left and right reference pointers. No array needed.

Member Avatar for ARaza110
0
207
Member Avatar for Jessurider

Where is the code that produces the image you show? The posted code when executed: shows a window with a single button on it.

Member Avatar for NormR1
0
180
Member Avatar for nikelin

Sounds like you have a 'shadowed' variable. Two variables with the same name at different levels of scope.

Member Avatar for nikelin
0
119
Member Avatar for Jessurider

Where in your code do you see the value of the variable as it is incremented? Add a println to show its value every time it is incremented. Is the method being called two times when you think it is being called once?

Member Avatar for Jessurider
0
282
Member Avatar for yapaarachchi

Can you explain your project a bit more? Does this have to do with algorithms for merging the contents of images?

Member Avatar for sirlink99
0
96
Member Avatar for yumyam09

Interesting problem. If the computer is off, how do you execute a program? Do you have a second computer that is running and an electronic connection between the two so that the second computer can turn on the first one?

Member Avatar for stultuske
0
188
Member Avatar for ARaza110

Do you have a small test program with a text field that compiles and executes to demonstrate the problem?

Member Avatar for ARaza110
0
703
Member Avatar for jason_joseph60

[QUOTE] it is showing some error which i can't solve or debug...[/QUOTE] When you get an error please copy and paste it here. That will speed things up for you.

Member Avatar for NormR1
0
125
Member Avatar for Voldemort2

[QUOTE]same code i did previously couldnt give all the data[/QUOTE] Sorry, I don't understand what you mean. Do you mean that you did not read all the data in the file with the second code? How much did you read? Compare that with how much was read with the first …

Member Avatar for NormR1
0
920
Member Avatar for winecoding

Will the user be using Eclipse to execute your program? Or do you plan on creating a jar file that can be copied to other locations? [QUOTE]How can I change the program to allow the user dynamically input the parameter after clcking "run Java application".[/QUOTE] How does Eclipse get involved …

Member Avatar for stultuske
0
233
Member Avatar for djbhoco

[QUOTE]Can anyone help?[/QUOTE] What do you need explained? Can you describe what is happening with your code, perhaps show the output and explain what is wrong with it and show what you want the output to be.

Member Avatar for mKorbel
0
240
Member Avatar for sirlink99

[QUOTE]I am having some Issues arranging the buttons[/QUOTE] Can you describe the issues?

Member Avatar for Ezzaral
0
169
Member Avatar for sirlink99
Member Avatar for sirlink99
0
119
Member Avatar for arvindikchari

Have you looked at how to read an HTML page with a form tag, parse out the parts you need to fill in and how to recognize the captcha image and display it?

Member Avatar for NormR1
0
195
Member Avatar for b1izzard

How do you want to access the words? Is a category a word? Or a phrase? Is it something that you search for? An idea: Map<Category, ArrayList<Word>>

Member Avatar for JamesCherrill
0
200
Member Avatar for Jessurider

What do you mean by "printing"? Do you want a copy of the GUI component and contents written/printed to paper?

Member Avatar for NormR1
0
120
Member Avatar for baby_c

Here's how to copy and paste the command prompt: To copy the contents of the command prompt window: Click on Icon in upper left corner Select Edit Select 'Select All' - The selection will show Click in upper left again Select Edit and click 'Copy' Paste here. Your posted code …

Member Avatar for baby_c
0
216
Member Avatar for fatjoy25
Member Avatar for teo236
Member Avatar for teo236
0
246
Member Avatar for BlackGazer

Do you need a state flag that tells you where you are in the get input / show results cycle? Use the flag to clear out the current values shown and display the newly entered ones.

Member Avatar for contra_shadow
0
347
Member Avatar for solomon_13000
Member Avatar for nmaillet
1
171
Member Avatar for Jessurider

Where are you displaying the String? In a text component or where? Different components have different ways of displaying text.

Member Avatar for Jessurider
0
102
Member Avatar for rmsagar

[QUOTE]But it is not working as expected.[/QUOTE] No computers do what you tell them to do, not what you want them to do. What is it supposed to do? Can you explain the logic? Think about this: If input is Apple then it is not Orange

Member Avatar for geniarrol03
0
152
Member Avatar for Farhad.idrees

also you could use an array to contain your choices and use the random number to index into the array.

Member Avatar for sirlink99
0
182
Member Avatar for Jessurider
Member Avatar for NormR1
0
169
Member Avatar for harinath_2007

Are there any error messages when you manually execute the program? Does your code ignore exceptions or does it use printStackTrace when it catches an exception?

Member Avatar for NormR1
0
123
Member Avatar for AhmedGhazey

I see the thread is marked as solved. If you have solved your problem, could you please post your solution so the next person with the same problem can find the solution here. Thanks

Member Avatar for ahmaadaadel
0
4K
Member Avatar for baby_c

You need to do some more research on the classes you are using. For example what does the API doc for the DataInputStream class say it is used for? The data that is read is translated into an internal format, not into Strings. What happened when you used the BufferedInputStream? …

Member Avatar for baby_c
0
216
Member Avatar for willywhomperz

Can you show the input and output of the program and describe what is wrong with the output and say what the output should be? [QUOTE]It should count the same word once instead of twice.[/QUOTE] How are you keeping track of what words have been counted so that you don't …

Member Avatar for NormR1
0
274
Member Avatar for bhawna_5nov

Please edit your code and wrap it in code tags. See the [ code ] icon above the input area. Try debugging your code by: Add a println to your actionlist method to print out the values of the variables it is using. Add a trailing else clause at the …

Member Avatar for masterofpuppets
-1
265
Member Avatar for masterofpuppets

[QUOTE]I receive the client request to create a new album with the album name being encoded[/QUOTE] What kind of data type is the name received as? For debugging Can you print it out char by char using the String.charAt() and Integer.toHexString() methods to show the values of each character? Perhaps …

Member Avatar for masterofpuppets
0
173
Member Avatar for sirlink99

[QUOTE] when I load it the frame is clear for like 20 seconds[/QUOTE] Probably the Thread.sleep(20000); statement. Take that out it will speed up.

Member Avatar for mKorbel
0
2K
Member Avatar for duuude
Member Avatar for Anuradha Mandal
0
139
Member Avatar for eman 22

Is this a java programming problem? If so, please post your code with questions or the problems you have having implementing the algorithm. Be sure to include documentation on the algorithm you are trying to implement. Or is it an algorithm design problem?

Member Avatar for Anuradha Mandal
-1
99
Member Avatar for bhawna_5nov
Member Avatar for NormR1
0
164
Member Avatar for gbatemper

One way to return to an earlier piece of code is to use a loop: [CODE]begin loop do menu stuff check user's response do what user wanted go back to beginning of loop <<< this can be automatic or done by continue statement end loop[/CODE]

Member Avatar for NormR1
0
5K
Member Avatar for Java John needs
Member Avatar for NormR1
0
279
Member Avatar for Krokcy

[codE]Calendar calendar = Calendar.getInstance();[/codE] [QUOTE] this does not update after the program has been launched.[/QUOTE] Its an assignment statement that puts the current value of something in a variable. If you want a new/current value assign it again now. [QUOTE] i want it to be able to count the number …

Member Avatar for Krokcy
0
189
Member Avatar for sagngh8

Why post this more than once here? [url]http://www.daniweb.com/software-development/java/threads/371217[/url]

Member Avatar for Ezzaral
0
456
Member Avatar for manish250
Member Avatar for hfx642
0
200
Member Avatar for rsandp

Look at the String class and the Integer class. Both have methods to do that.

Member Avatar for NormR1
0
91
Member Avatar for yancouto

Why do you think your translate and scale calls will create a mirror image? If you comment those two method calls out, the image is displayed.

Member Avatar for Ezzaral
0
543
Member Avatar for varoluscu_prens

What kind of file are you reading? How was it created? It looks like it contains Unicode characters with a leading id character. Here is the contents of a file in hex that I created with Wordpad by selecting Unicode Text Document as the Save type: FFFE540068006900730020006900730020006100200074006500730074002E00 Notice there is …

Member Avatar for varoluscu_prens
0
179
Member Avatar for Jessurider
Member Avatar for akasekaihime

[QUOTE]create a registration form but it is not running[/QUOTE] Please explain what you want your code to do in more detail. Show what it does now and add comments describing how the output is incorrect and what you want the output to look like.

Member Avatar for NormR1
0
125
Member Avatar for Armanious

[QUOTE]Is there any possible way to condense this three dimensional array into a two dimensional, or better yet, one dimensional array?[/QUOTE] Yes, define a mapping from x,y,z to i It might help if you took a piece of paper and wrote out a small 3 dim array with the x,y,z …

Member Avatar for skatamatic
0
1K
Member Avatar for jamd200

Do you have a question about java programming? What message does your program put out if there are not two arguments?

Member Avatar for jamd200
0
2K
Member Avatar for bhawna_5nov

Check that your {}s are correctly positioned. For example where is the ending } for the class? All your code should be in a class definition. Is it?

Member Avatar for javinpaul
0
282
Member Avatar for jamd200

An idea for an improvement, use a drop down list to chose the colors instead of requiring the user to type them in.

Member Avatar for jamd200
0
7K

The End.