NormR1 563 Posting Sage Team Colleague

Where is the path to the src folder pointed to by the -classpath option?
You keep leaving that off. You need to have it in the classpath.

What folder is the src folder in? If it is in the beerV1 folder then you only need to add a . to the -classpath you are using:

-classpath D:/tomcat/common/lib/servlet-api.jar;.

NormR1 563 Posting Sage Team Colleague

Java SE doesn't know about the insides of many types of files.
You will have to
either find a third party package that does know how to make the changes you want to make
or you will need to get documentation for the layout of the contents of the file and write code to add to or update the contents of the file. If you find out what the contents of the file are, then we can help you write the code to change the file.

NormR1 563 Posting Sage Team Colleague

getting an uninitialized variable

Give the variable a value when you define it.

When you get an error message you should copy and paste here the full text. Just copying part of the message can leave off valuable information.

The code has many missing }s. The if statements at the end of the code all have {s without the matching }s

The code you've posted is trying to do too many things all at once. I suggest again that you do one thing at a time. When you get that one step done, then try adding the next step.
The first step should be getting the user's input into an array. And print it to see what is there.
When you can do that then add the next step.

NormR1 563 Posting Sage Team Colleague

Did you undererstand my explanation of the problem and how to fix it?

NormR1 563 Posting Sage Team Colleague

Please post the full text of the error message that shows what the index's value is.

If an array is empty, it does not have a first element (index of 0)
The code should test the array's length BEFORE trying to index into it.
A length of 0 means there are no elements.

NormR1 563 Posting Sage Team Colleague

Try doing some debugging by adding some println statements that show the values of the variables as they are changed.

Make sure that there is only one object being used. For example are you calling the set method for one object and calling the get method with another object.

NormR1 563 Posting Sage Team Colleague

If you have problems with your code, please post the code and describre the problems you are having.

NormR1 563 Posting Sage Team Colleague

Look at the Floating-Point Literals section.
I think a literal is what you are calling a constant.

NormR1 563 Posting Sage Team Colleague

put all the required libraries, resources everything into single jar file , so that i can use one single jar file .

Extract everything from all the other jar files and use the jar command to put all the extracted files into the single jar file.

NormR1 563 Posting Sage Team Colleague

The posted command line doesn't have the -classpath option. You should get a different error with that command line. For example: javac: invalid flag: E:/JAVA/JSP/beerV1/src
Please copy the full contents of the command window so we can see what has been entered and what the javac program's response was.

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.

NormR1 563 Posting Sage Team Colleague

how will my main function know when the time os over.

The thread could call a method before it exits to tell other code that it is exiting the thread.

if i sleep my main thread will that also make my spawned threads

That shouldn't happen. A call to the sleep() only effects the thread that calls sleep(). The other threads will continue executing.

new Thread(thread_bw3).stop();
This code has several problems.
It makes not sense to create a new thread and immmediate call its stop() method.
The stop() method is deprecated and should not be used.

I'm confused about what you are trying to do. Can you explain in more detail?
Is each thread to have its own duration? The posted code makes it look like there is only one duration for all the threads.

NormR1 563 Posting Sage Team Colleague

Did you add a listener to the button?

NormR1 563 Posting Sage Team Colleague

Try another browser.
Contact the authors of the program. The problem looks like its with the HTML and the browser, not with java.

NormR1 563 Posting Sage Team Colleague

Each thread could get the time it started by calling the System class's currentTimeMillis() method when it starts and call it later in execution and compute the duration the thread has run by subtracting the start value from the current value . When the user time has run out, the thread would exit.

NormR1 563 Posting Sage Team Colleague

On my Windows 7 system, the path and filename of the executable is:

C:\Windows\System32\javaw.exe

I copied and renamed the javaw.exe file to a temp folder and executed it with:

C:\Temp\javawxyz.exe Testinsurance

Then looked in the Task Manager and saw javawxyz.exe listed.

NormR1 563 Posting Sage Team Colleague

No idea.

Have you tried making copies of the javaw.exe file and renaming them?

NormR1 563 Posting Sage Team Colleague

Re-read my past posts.

Did you try putting the path to the src folder on the -classpath option?

NormR1 563 Posting Sage Team Colleague

I don't see the path to the src folder in javac's -classpath option. Try putting it there.

Did you write the small test program and test it the two ways I suggested?
What happened?

NormR1 563 Posting Sage Team Colleague

What is the command line you are using? Do you put the path to the src folder in the -classpath option used in the command line?
I don't know if the javac command will use both the environment variable AND the -classpath option's value.

To see what classpath is used by the java program make a small program with this:
System.out.println(System.getProperties().getProperty("java.class.path"));

and execute it with a -classpath option and without to see the difference.

NormR1 563 Posting Sage Team Colleague

Can you copy the html that is loaded and post it here?

Some browsers want the class name on the code= attribute of the <applet tag, not the filename.
For you it could be: code=Client

What browser are you using? Have you tried it in another browser?

NormR1 563 Posting Sage Team Colleague

What did Google give you?

NormR1 563 Posting Sage Team Colleague
NormR1 563 Posting Sage Team Colleague

Which of those 4 steps are you working on? Do one at a time: code it, compile and test it.
When it works move to the next one.
When you have problems and want help, post your questions here.

NormR1 563 Posting Sage Team Colleague

results[4][5] = i; // problem here nothing gets stored

How do you know? Is the statement executed? It's inside of an if statement.
Add a println immediately after that statement that prints out the value of results[4][5] and the value of i. Then you'll see what was stored in the array.

NormR1 563 Posting Sage Team Colleague

That doesn't look like valid java code. var is not part of java.

What happened if I omit the "f" at the end?

If it is java, compile and execute the program and see what happens.

NormR1 563 Posting Sage Team Colleague

create a JAR file which will containt everything required.

You might not need to put the contents of the other jar files into your jar file. The manifest file has a record/line where you can specify other jar files: Class-Path:

One of my manifest files:

Main-Class: CmprFolders
Class-Path: DocumentViewerWParser.jar

Is your question about how to use the jar command
or is it about how to use an IDE?

NormR1 563 Posting Sage Team Colleague

I'm getting a few errors

You need to post the full text of any error messages that you need help with.

not sure how to continue

To see what is in the token array use the Arrays class's toString() method to format the array for output: System.out.println("an ID "+ java.util.Arrays.toString(theArrayName));
Replace "an ID" with a description of what is being printed.

What does the assignment say you need to do with the tokens that are in the array?

NormR1 563 Posting Sage Team Colleague

Read the API doc for the packages you are using.

NormR1 563 Posting Sage Team Colleague

Look at what is to be printed on each line. The first line has one number, the second line has two number. Each line starts with its line number and decrements. Make some loops that follows those rules.

NormR1 563 Posting Sage Team Colleague

Client.class is not a class name. It looks like a filename.
Can you view the HTML you have loaded and post it?
Some browsers do not like filename where there should be a class name.

NormR1 563 Posting Sage Team Colleague

I think JTextPane is the class to use. I can't find any sample code on my PC. Try Google.

NormR1 563 Posting Sage Team Colleague

Can you explain how these steps are done? What are the steps the program must do?

1)create another array to compare it against.

What is in this second array and how are its contents put into the array?

2)print out just the single numbers, not the duplicates

How does the program find the single numbers so it can print them?

dont fully understand

That's why you need to work on what steps the program is going to take to solve the problemn BEFORE writing any code for it.

NormR1 563 Posting Sage Team Colleague

Look at the prinf() method. It has formatting Strings that should help.

Also the String class's format() method could be useful.

Kronolynx commented: thanks +0
NormR1 563 Posting Sage Team Colleague

Does the OS have any other ways to tag running programs so you can tell which is which?

NormR1 563 Posting Sage Team Colleague

Pad the Strings in the first column with spaces so that they are all the same length.
say you want the first column to be 20 characters wide and the String to print is 15 chars long, then you need to add a String of 5 spaces to fill the first column to 20.
Make a method that takes the String and the width of the column and returns a new String with the input String padded with spaces to the width number of characters.

NormR1 563 Posting Sage Team Colleague

sometimes gives me errors

Please post the full text of the error messages.

What is the algorithm/design that you have for removing duplicates? Can you list the steps the program should take to find and remove duplicates? When you get a good algorithm, then work on coding it in java.

NormR1 563 Posting Sage Team Colleague

What part are you having problems with?
Displaying a button
Adding a listener to the button
Executing the listener's code when the button is pressed
Doing a save in the listener code

NormR1 563 Posting Sage Team Colleague

If there are only two balls and they are at different locations, then you need to paint each ball at its own location. You could remove the loop and draw each ball (ball[0] and ball[1]) separately at its own location. The existing loop draws the two balls at the same location.

NormR1 563 Posting Sage Team Colleague

this isn't working

Please explain\ what happens. If the code throws an exception, copy the full text and paste it here.

One problem I see is that you are not saving the String returned by the replace() method. The value of a String object can not be changed. The replace() method will return a new String that has had the changes done to it. The original String will not be changed.

NormR1 563 Posting Sage Team Colleague

That looks like the normal contents of a browser's java console that is displayed when the browser uses the java plugin. It does not show that there are any problems.

NormR1 563 Posting Sage Team Colleague

Using a String to get access to a class sounds like you need to use a Map or reflection.
Using a String to create a call to a method sounds like you would need to use reflection.

NormR1 563 Posting Sage Team Colleague

Look at the position of {}s in the parameter() method. Some are missing that will effect how the code executes.
Indenting code does not make it be included within an if or else statement.

NormR1 563 Posting Sage Team Colleague

Use a modal dialog.

NormR1 563 Posting Sage Team Colleague

Why not use a loop to copy an element from each array into the target array?
Define the target 2D array and copy to elements 0 and 1

NormR1 563 Posting Sage Team Colleague

program is not painting anything

What method does the drawing of the ball? Is that method being called? Add a println to print a message to show that it is called.
What code calls the method where the ball is drawn?

Calling the repaint() method asks the jvm to schedule a call to the paintComponent() method. Where have you coded a paintComponent() method that can be called by the jvm after a call to repaint()?

NormR1 563 Posting Sage Team Colleague

To see what the computer sees print out the value of hint with a println after it is read.
Be sure to add String delimiters before and after the variable so you can see all its characters:
System.out.println("hint="+hint+"<");

The equals() method is used to compare String values.

NormR1 563 Posting Sage Team Colleague

The method is defined to return an int value. The compiler sees that there could be a possibility of the code getting to the end of the if/else if statements and exiting the method without returning an int value. What if hint = "XXXX"?
Add a return with an int value at the end of the method.

NormR1 563 Posting Sage Team Colleague

Look at the pattern of what goes on each line. How many numbers go on the first line?
How many on the second? etc

Use some loops: one for each line and one for the contents of a line

NormR1 563 Posting Sage Team Colleague

a(which is 1)

Can you explain what you mean here? Are you talking about the char value: 'a' or what?
Or are you talking about an int variable named a: int a = 1;
Your discussions are very ambiguous and impossible to follow unless you define the terms you are using.

NormR1 563 Posting Sage Team Colleague

Normally you add a listener to the items you want to be able to receive notice of events like clicks.