Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Looks reasonable to me. How are you calling ndihmesePaint() ? If you are calling it from the event dispatch thread, such as from a button click, then your repaints() may be getting blocked on the queue.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Don't use == or != to compare Strings. Use the equals() method.

Also indent you loops and if() blocks. It makes the program flow much easier to follow.

thedalek commented: Very helpful. +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, you need to delete all of those constructors then and fix your entries in PayableInterfaceTest to use the valid constructors from those classes. You have used four arguments for all of them. Some require more parameters.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Who wrote the entries in PayableInterfaceTest? Did you?

I'm guessing that you had errors on the constructors and used the IDE "Create constructor..." suggestion to "fix it".

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I am saying those constructors probably should not be there at all. A parameter list of (String string, String string0, String string1, double d) looks to be generated from some automated source (introspection of a class file, etc).

You could alleviate the error by creating the necessary zero-argument constructors in the parent classes, but that doesn't address why those auto-generated constructors are there in the first place.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Re-read what James wrote above about the constructor.

Edit: Looking at the code, the error is actually coming from this constructor definition

BasePlusCommissionEmployee(String string, String string0, String string1, double d) {
        throw new UnsupportedOperationException("Not yet implemented");
    }

I'm not sure what generated that constructor, but I don't think you want to leave it there as is.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

>no but...
Yes, CommissionEmployee does have a constructor defined.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It says more than that. The stack traces will indicate the exact error and the line it occurs on. Read them carefully.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Do you have a component in the center region?

If the toolbar is the only component in the north region and you have a component in the center, setting the toolbar to not be visible is sufficient and the center component will expand to fill the area that previously displayed the toolbar.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I was just referring to a hashmap that mapped the string key values to the JButtons, like so

Map<String,JButton> buttonMap = new HashMap<String, JButton>();
 ...
buttonMap.put("A",btnA);
buttonMap.put("B",btnB);
buttonMap.put("C",btnC);
buttonMap.put("D",btnD);

The key listener needs to be added to the component that will have the focus, such as the main panel or frame. Adding the listeners to the buttons themselves won't work because the buttons won't have the focus to receive the events.

Key bindings could also be used here.
http://download.oracle.com/javase/tutorial/uiswing/misc/keybinding.html
You would have to create a binding for each key event to the appropriate action. The benefit of key bindings would be that they don't have the same focus issues that key listeners do.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Do you just want hot keys for some buttons, which require you to hold down the Alt key to access? Or do you need them to respond directly to key typed events? You can set mnemonic hot keys with setMnemonic() on each button.

If they have to respond to keys being typed, you could create a Map to associate the key characters to the button instances and call doClick() on the buttons

addKeyListener(new KeyListener() {

    public void keyTyped(KeyEvent e) {
        JButton typedButton = buttonMap.get(String.valueOf(e.getKeyChar()).toUpperCase());
        if (typedButton!=null){
            typedButton.doClick();
        }
    }
...
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I have no further idea. If it's coming from their API classes then you may have to contact them and ask about it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

start() is a standard Applet lifecycle method that you can override. You don't need to call it yourself.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you change that line to

loggedIn = Highscore.isLoggedIn(this);

You should also move that to the start() method instead of init().

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
update [tableName] set [valueFieldName] = [valueFieldName]+[amount] where [row criteria expression]

Use Statement.executeUpdate() or PreparedStatement.executeUpdate() to execute the update.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try replacing "applet" with "this". They don't have posted javadocs for the API but I would guess those are references to the current Applet instance.

Edit: I opened the Highscore class and yes, those are Applet references, so this should work.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your touch method is a void return

public void touch(Kutia[][] k)

You can't assign that to your 'c' variable.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take it out? Use or create the appropriate parameter variable?

I don't know because I have no idea what that code you copied and pasted from somewhere is supposed to do and I have no knowledge of the rest of your program. You need to read the docs more closely and figure out what that 'applet' variable is in their code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, there you go. You can't just pass around parameters that don't exist.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Exactly what are the errors? This line as written is not valid syntax

Highscore.save(applet, score [,level]);

You cannot have brackets around a parameter like that. Perhaps there are two versions of that method, one that includes level and one that does not? If you copied it from documentation, maybe they were indicated an optional parameter?

Post the stack traces of the errors.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Let's take a look at one of the rules under the Keep It Organized section, shall we?
- Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

How about some code or even just a specific question that indicates you made even the slightest effort on this yourself?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, bunny09 (that's your name on Cramster, right?), perhaps you should make an attempt to write your own code for your homework assignment and then you would know what the program would or would not do.

Edit: Hmm, no apparently 'bunny09' is just the user who posted this question in it's entirety in 2009 and you pasted it here? What exactly are you trying to accomplish?

jonsca commented: Good detective work! +7
Saith commented: 'That's what she said jonsca" .. but no, really. Good job. +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, a good place to start is the JDBC tutorial:
http://download.oracle.com/javase/tutorial/jdbc/basics/prepared.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'm sure that quite a few people do.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You commented out the statement that actually built the prepared statement

//prepareState = connection.prepareStatement(sqlInsert);
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Another option would be to use a Map, such as HashMap, with the direction as the key and the count as the value.
Or an array could be used very easily if the Direction constants are int values 0-4.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You'll need to make sure the J2EE libs are included on your build classpath. You can read about doing this with ant here: http://download.oracle.com/javaee/5/tutorial/doc/bnaan.html#gexah
or perhaps you may want to look where you got the example code from to see if they have any instructions for use with their build files.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, I couldn't really offer any reason why they would want to use the older AWT Applet - only that he was using it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You will need to add their jar file or classes to your classpath.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you import Highscore? Where is the Highscore class coming from.

What "api" you are referring to?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Guess what happens here when 'LN1' has less than 7 characters?

LN1.substring(0,7)
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

mKorbel, note that Phil++ was using Applet, not JApplet. Your advice is correct for JApplet, but in Applet paint() is the appropriate method to override.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You could also initialize the variable to your default before the switch.

String numWordString="";
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

>I'm still not sure why my original idea didn't work as all outputs showed that it should have been correct!
What you originally posted does look as though it should work, but you haven't provided enough of the rest of your code to determine the problem. As others already mentioned, post more code if you want to investigate it further.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to delete the characters from your StringBuilder before your second loop or create a new one.

You could also consider deleting just the last 20 characters and doing away with the second loop altogether.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

In your user control panel, choose Edit Options and deselect the email options.
http://www.daniweb.com/forums/profile.php?do=editoptions

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your question is not clear. Perhaps you can explain a little more.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Of course it isn't. Let's say I put in "2357" as my input number. What are you expecting this statement to do?

System.out.print(convertIntegerToWords(2357) + convertIntegerToWords(2357) + convertIntegerToWords(2357));

I don't see that number in your switch statement. Do you? And why make the exact same method call exactly three times?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to set the color and draw each letter individually as you loop through them. You'll have to increment the position on the screen as you draw as well.

Note that you can specify the offset and length to draw in the method call, so your loop variable can be used like so to draw a single character

g.drawChars(element, i, 1, getWidth()/2, getHeight()/2);

You'll need to shift your x value incrementally as you go.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Do you want to take a String an make a char array out of it? If so,
This is one way to do it.

String name = "Phillip";
char[] arrayName = new char[name.length()];
for(int i = 0; i < name.length(); i++)//.length() is a method for the String class, so it has parenthesis
{
   arrayName[i] = name.charAt(i);//charAt() is a method that can be called on Strings take a look in the api if you need more info.
}

Then to print out the array:

for(int i = 0; i < arrayName.length; i++)//.length for an array is not a method so it doesn't have parenthesis  
{
  System.out.print(arrayName[i]);
}

You only need a single method call to get the string as a char array someString.toCharArray() No need to write a loop for it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

At the least, you'll need to download the Java 6 JDK.

Grab the JDK + Netbeans bundle if you want an IDE as well.

Java EE is necessary if you intend to develop web-based Java applications with JSP, Servlets, etc.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Edit: oops, cross-post. ^^ What Jon said.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to be a bit more specific with your question. As it is, this doesn't make any sense.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@tasty: Please post your code and specific questions about the parts you are having trouble with.

@saruba: The point of the forums is to help people fix their code by themselves - not write it for them.

SARUBA commented: You right in a way, thanks. But some people ask questions without the knowledge of VB.NET. That's why I use that way. +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Splitting to new thread. Raniel, please do not hijack old threads when posting a question.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Vb code for parsing HTML Table
This is the PHP forum. Posting your VB code isn't very relevant in this thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, the change did indicate that duplicate content would be punished and unfortunately tech help forums do end up answering many of the same questions over and over again. New students roll into the same old curriculum and we end up with 500 more threads about inventory programs.

I don't see how any large and long-running forum could avoid such duplication on many key words.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This thread is from 2005. I assume the OP has moved on. Closing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Agreed. Moving.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

His assignment, which he posted here, states that he is suppose to use the given Taylor series expansion.