2,777 Posted Topics

Member Avatar for NexG

[QUOTE]program that outputs the probability of n amount of coin tosses[/QUOTE] What does your program output now? If you want it to output something different, please explain and show what you want.

Member Avatar for NexG
0
2K
Member Avatar for isebas

Can you explain what your problem is? Do you get errors or is the output wrong? Post the output with your questions or comments and show what it should output. Comments on your coding style: Don't have statements on the same line following a { Put the statement on the …

Member Avatar for isebas
0
236
Member Avatar for nickliutw

[QUOTE] if I return Distance it still mark at compiler error. [/QUOTE] You forgot to post the error message. Also you need to show the code that causes the error. [QUOTE]What should I return here?[/QUOTE] The method says it returns a Distance object. Do you want to return the current …

Member Avatar for hfx642
0
122
Member Avatar for alteran

First suggestion would be to change to using Swing components vs AWT. Change the Frame to JFrame. Instead of trying to change this program, I'd suggest you start with a new program and build the GUI from the beginning as per your instructions. When you get the GUI laid out, …

Member Avatar for alteran
0
195
Member Avatar for chixm8_49
Member Avatar for stevanity
0
82
Member Avatar for selma_aktra

It executes for me: [CODE] Scanner my_scanner = new Scanner("www.exampledomain.com/abc/[[FLAG1]]/abc_[[FLAG2]]gfc").useDelimiter("[[|]]"); System.out.println(my_scanner.next()); //==> www.exampledomain.com/abc/[[FLAG1]]/abc_[[FLAG2]]gfc [/CODE]

Member Avatar for selma_aktra
0
180
Member Avatar for jtodd

I don't know why you get that error. Are you using an IDE? You should be getting a NPE because a variable at that line does not have a value.

Member Avatar for JavaStudent321
0
432
Member Avatar for ITHope

Check for correctly pairing of { with } You need to properly format your code so you can see the pairings of the { and } The line with the ending } should start vertically below the line with the starting { All lines between them should be indented 3-4 …

Member Avatar for NormR1
0
153
Member Avatar for Sekhrian

Does the code compile and execute? If not, please copy and paste the error messages here. How does your code choose a word? The while loop will read to the end of the file.

Member Avatar for Sekhrian
0
96
Member Avatar for mistersalty

If you are not sure what the results of your conditions, print them all out and see what they return. For example: System.out.println("(year % 4 == 0)=" + (year % 4 == 0)); Do that for all the conditions and you should see where the problem is.

Member Avatar for jee08
0
168
Member Avatar for NexG

How do you get the value to be reversed? As a String? Or as an integer?

Member Avatar for NexG
0
186
Member Avatar for laitingfei

[QUOTE] their messages like "YOU WON!!" and "GAME OVER!!" do not show up[/QUOTE] I just ran the code and did get the message "YOU WON". Better do some debugging to see why you don't.

Member Avatar for Taywin
0
311
Member Avatar for vishal1949

What happened to your earlier post of this problem? Where is the code to test the methods? The main method looks empty. The code you posted does NOT compile.

Member Avatar for Taywin
0
280
Member Avatar for PurpleHeaven

What does the current code do? What is wrong with the results? Show the output and explain/show what it should be.

Member Avatar for Taywin
0
219
Member Avatar for hfx642

Action listeners are put in a list and, I assume, are called based on their order in the list. Can you put them in the list (ie add them) in the order you want them called? Does the component have methods for getting to the list of listeners that would …

Member Avatar for JamesCherrill
1
665
Member Avatar for mohitj786

What is the problem? Do you get errors? Is the output wrong? Please post the output to show what is wrong. What is the purpose of the variable b?

Member Avatar for imyself
0
150
Member Avatar for eddieteddie
Member Avatar for NormR1
0
191
Member Avatar for gedas

The method is to print the String and pad it with spaces(?) or truncate it to width? Where are the words you talk about? Is the method to parse the String and split it at the white spaces to produce words? Can you give several examples of what you what …

Member Avatar for Zaad
0
227
Member Avatar for hackit

Since java has this error: Null[B]Pointer[/B]Exception, I assume that is has pointers. The question is what is the behavior of java pointers and how can you use them. They have very little in common with c pointers.

Member Avatar for hag++
0
120
Member Avatar for electricBunny
Member Avatar for electricBunny
0
176
Member Avatar for plasticfood

[QUOTE] Drawing in applets is almost always done with double-buffering. This means that drawing is first done to an offscreen image, and when all is done, the offscreen image is drawn on the screen. [/QUOTE] From your link. Have you tried copying the ideas that are shown on that site?

Member Avatar for NormR1
0
303
Member Avatar for behemothdave

[QUOTE]I am unable to enter more than 1 television show.[/QUOTE] What happens after the first show is entered? The code looks like it is in a loop and should continue. Add a println to show the value of d inside of the loop as the loop goes around.

Member Avatar for behemothdave
0
248
Member Avatar for kalz

[QUOTE] fires off the jar[/QUOTE] Can you explain what "firing" a jar means? A jar contains files that could include java class files one of which could have a main method.

Member Avatar for NormR1
0
287
Member Avatar for inilahs
Member Avatar for NormR1
0
61
Member Avatar for asdftrew

[QUOTE] it does print out what I expect[/QUOTE] Can you show what is printed out and show what you expect or want to be printed out?

Member Avatar for JamesCherrill
0
143
Member Avatar for emmstarr82
Member Avatar for emmstarr82
0
3K
Member Avatar for Matth963

Yes void is OK for a method return type. Use it when the method does not return anything. Do you get any error messages when you compile the code? The names of your methods are misleading. A method beginning with get should return a value and not be void. Before …

Member Avatar for NormR1
0
136
Member Avatar for drpn

Is the definition for the Chatclient class on the classpath so the compiler can find it?

Member Avatar for NormR1
0
60
Member Avatar for vishalbhavsar

[QUOTE] Is there any mechanism to read a specific object from a file? I[/QUOTE] I think you have to read the file sequentially from the beginning. If the file has more than one object then you will need to read the ones before the desired object to get to the …

Member Avatar for JamesCherrill
0
178
Member Avatar for pro_learner

[QUOTE] how to upload a file to a folder[/QUOTE] I assume that the file is on your PC and the folder is on a server. If that what you have, then you need some code on the server that you can give the file to and tell it where you …

Member Avatar for JamesCherrill
0
538
Member Avatar for ITHope

Does the code compile and execute and give you the correct results? One shortcut would be to return the boolean results of this expression: (x==y) directly vs using an if/else statement. (x==y) gives a boolean result of true or false. No need to test it, just return it. See what …

Member Avatar for dimasalang
0
249
Member Avatar for marsh_mallows11

Is this your homework assignment? Do you have specific questions about how to do your assignment? Do you have any code you are having problems with? Post them here. [CODE]public class IMultiSet{[/CODE] This looks like a class definition not an interface.

Member Avatar for NormR1
0
574
Member Avatar for glamourhits

[QUOTE]How to implement the (20.0%) and the (9.0%) in the Deductions area[/QUOTE] Do you have the formula for computing those values?

Member Avatar for glamourhits
-1
162
Member Avatar for PHkiDz

[QUOTE]way of coding list in permutation.[/QUOTE] Can you explain what you want the code to do?

Member Avatar for NormR1
0
178
Member Avatar for billingsj09

What do you need help with? The Scanner class will be useful with reading the file. The String class has methods for comparing Strings. The ArrayList class can hold Strings that need to be saved for later.

Member Avatar for NormR1
0
197
Member Avatar for mozy1691

[QUOTE]it shows errors i need help to clean it[/QUOTE] Please post the FULL text of your error messages here.

Member Avatar for NormR1
0
229
Member Avatar for jiraiya

Is the value of the variable: is null? Print out the value of path to see what file it is looking for and check if that file exists. Are the files on the classpath? Check the API doc for the method getResourceAsStream

Member Avatar for JamesCherrill
0
15K
Member Avatar for sha11e

[QUOTE]way to make it run by just double clicking the jar[/QUOTE] Most java installations on Windows add an entry to the OS's file association table to open a jar file with the correct command line so when you double click on the the jar file the command is executed with …

Member Avatar for JamesCherrill
0
366
Member Avatar for janice91

[QUOTE] i need experts to kindly help me out.[/QUOTE] Can you explain what your problem is?

Member Avatar for JamesCherrill
0
125
Member Avatar for ajaxx195

Sounds like an advanced topic for a beginner. Look at the JTextxxxx classes for the possibility for displaying text and allowing the user to enter text on the same area as the displayed text. I'm not sure how to make some area's R/O to restrict the user's input.

Member Avatar for NormR1
0
116
Member Avatar for esdel

Many java programs are distributed in .jar files. Installing a JRE should set your OS to call the java program when you try to open a jar file.

Member Avatar for jwenting
0
200
Member Avatar for dennysimon

Please post the FULL text of the error message. 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. Also show the …

Member Avatar for jwenting
0
1K
Member Avatar for Nox_1031

Cross posted at [url]http://www.java-forums.org/new-java/48227-code-calculate-mode-using-array.html#post232571[/url]

Member Avatar for Nox_1031
0
233
Member Avatar for Nathan_11

What is there about the output that makes you think you need a nested loop? You can generate that print out with a single call to println by using \n characters to put the next String on the next line.

Member Avatar for JamesCherrill
-1
120
Member Avatar for sha11e

Scanner methods can be tricky. The Scanner buffers input and can block waiting for input. Or it can save a newline and return it to the nextLine call. For example if you enter: A word to the wise <PRESS ENTER> and use next() only "A" is read, and "word to …

Member Avatar for NormR1
0
139
Member Avatar for sirlink99

[QUOTE]NoClassDefFoundError: Applet/Main (wrong name: Main)[/QUOTE] The error says that the code= tag value does not match the class name Please post your html. What is the full classname including package of your applet?

Member Avatar for mKorbel
0
517
Member Avatar for mcddewitt

[QUOTE] want to add 1 to the name each time the user says yes and create a new object:[/QUOTE] You can't create new variable names when executing a program. Names are defined when you type them in. There are other ways to have "collections" of objects. For example save the …

Member Avatar for NormR1
0
97
Member Avatar for Ssnowlin

That was a mistake adding to the above's rep. I was trying to decrement it.

Member Avatar for NormR1
0
172
Member Avatar for fattyJ

[QUOTE] it doesn't read my text file into my array[/QUOTE] What do you do with the data you read from the text file? Your first while loop will read ALL of the tokens into the one variable. To see what is happening add a println in the loop to show …

Member Avatar for NormR1
0
932
Member Avatar for nickliutw

You've got a lot of the code for the program but I see you are missing the code that does the find. You would need to read in the search argument from the user and then loop through all the entries in the arraylist and compare what the user entered …

Member Avatar for NormR1
0
598

The End.