sillyboy 43 Practically a Master Poster
sillyboy 43 Practically a Master Poster

in C, classes will teach you to treat a String is simply an array of chars, and i think you should keep this in mind here.

i am not sure what your requirements are, but the easiest way to accomplish this, is probably to simply traverse through the String and print each element, followed by a "\t". maybe you need to actually store this as a String? (if so, shouldn't be hard to work out)

do you know how to traverse the String? (remember to consider it as a array of chars, and so as hints: String.length(), String.charAt())

sillyboy 43 Practically a Master Poster

i assume you are going to keep your input saved as a string. if so, is it always a space between each element (char)? or will there be instances where it may be "12 3"?

if it is a space between each element, it should be pretty easy, you just need to work out how to references the elements of the String individually, and add in the whitespace.

sillyboy 43 Practically a Master Poster

read the api on String.split(). it doesn't do what you think it is doing.

sillyboy 43 Practically a Master Poster

firstNumber and secondNumber are Strings (I am pretty sure you know this). since they are strings, == will only evaluate true if they are the same object. you want to use .equals to compare Strings in the way you intend.

tmoney7566 commented: Thank you for the help. +1
sillyboy 43 Practically a Master Poster

this link may help you: http://forums.java.net/jive/thread.jspa?threadID=42506

there is also a link at the bottom of the page to a sun reference. one of my guesses would be the fact that repaint() doesn't guarantee an immediate execution, and so it may only call repaint() once at the end...

anyway, good luck.

VernonDozier commented: Thanks for the link. +11
sillyboy 43 Practically a Master Poster

so then I guess repaint doesn't seem to be triggering paintComponent properly. perhaps you could start googling since you have something to base a search off... i personally don't have anything else to offer on this :(

sillyboy 43 Practically a Master Poster

you are looking in the wrong place, it is falling over in the array_sum method. can you paste it?

sillyboy 43 Practically a Master Poster

yeah, it seems strange. have you tried putting a System out directly within the for loop?
the only things i can think of, are an InterruptException (but you should get a log of this), or repaint not calling paintComponent properly...

sillyboy 43 Practically a Master Poster

out of curiosity, what is generally your "fix" to this issue? (it may provide some clues)

sillyboy 43 Practically a Master Poster

ah, damn, guess i am wrong (you put that code within your ButtonListener right?).

well from the behaviour you have explained, (String)bankaccount.get(0) must be evaluating to an empty String.

sillyboy 43 Practically a Master Poster

ok, so if you did something like text1.setText("random text"), does this produce anything into the TextArea?

my guess is not, and so, as I said you have different instances of your objects.

sillyboy 43 Practically a Master Poster

what sort of errors do you get, or nothing happens at all?

i have a feeling that your ButtonListener is not using the objects created in Away (the ones you want it to, anyway).

sillyboy 43 Practically a Master Poster

what is the point in returning "enter" when all your logic related to "enter" is already complete within the method? and as i said previously, simply returning a value is useless unless you actually use it (e.g. assign it to something...).

olgratefuldead commented: Very helpful +1
sillyboy 43 Practically a Master Poster

you are returning the value, but doing nothing with it. another question, are you actually returning the correct value?

sillyboy 43 Practically a Master Poster
{
  int var = 0;
  somemethod(var);
  print var;
}

somemethod(int var) {
  var = 5;
}

this is just pseudo code. in this example, the output of the code (printing var) will NOT be 5, but 0. the value of var is passed to the method, and so the method can use this, but any modifications to var are only valid within the method, it doesn't change var of the caller.

sillyboy 43 Practically a Master Poster

you are passing by value, therefore any changes made to "output" are only made within the method.

sillyboy 43 Practically a Master Poster

no worries, let us know if you run into any more issues.

sillyboy 43 Practically a Master Poster

that isn't working? that code looks correct to me. as soon as your method sees a return statement it will terminate (it has found what it wanted and 'returns' the value to the caller). in your previous code you have an if / else and so each execution of the while loop generated a return (so the loop never actually looped).

if lookup() is always returning null, it means that .equals is never evaluating to true, OR the values.get(i) is generating null. in this instance though, i think the method is correct, and the fact that you haven't implemented your other function (e.g. insert) is the reason you are getting null.

do you actually initialise keys / values?

sillyboy 43 Practically a Master Poster

your variable i is undefined at those lines the compiler is pointing out. perhaps your "for" loop is supposed to encompass more than 1 statement.

sillyboy 43 Practically a Master Poster

my hint would be "just because you have an 'if' doesn't mean you need an 'else'". make sure you understand the consequences of using a "return" statement too. if you work this out, it will also answer the original question you had. let me know how you go...

sillyboy 43 Practically a Master Poster

i know there is more to the code, i am just saying it is incorrect. well the code is incorrect based on the commenting you have on the method. if you read the code, it doesn't actually do what the commenting says it should.

sillyboy 43 Practically a Master Poster

you could try to return null, but that code is incorrect.

sillyboy 43 Practically a Master Poster

do you understand what packages are?

a package of example.hello, does not mean having a folder called example.hello. if you want a file structure to represent example.hello, you need example/hello...

sillyboy 43 Practically a Master Poster

the answer is posted by verruckt24, and he has a good explanation of what is going on. i couldn't just give you the answer straight up, had to make you work for it :)

sillyboy 43 Practically a Master Poster

i am assuming the user doesn't even get to enter their value. am i wrong here? if so then input.nextInt() is not asking for any value...

do you know what the difference between declaring and initialising is? look at your declare() method, it should give you a clue as to what is happening...

sillyboy 43 Practically a Master Poster

if you use the default package (i.e. no package), you simply reference the folder containing all your class files. i am curious how you came up with the folder name example.hello, because it seems to resemble a package...

sillyboy 43 Practically a Master Poster

ok, your app if falling over @ player.java:14.

which is: human = input.nextInt();

at this point in your code, what does input represent?
note: there is a difference between declaring and initialising your variables / objects.

sillyboy 43 Practically a Master Poster

what is "input"?

sillyboy 43 Practically a Master Poster

if you have packages e.g. "com.myproject.main", it will be represented through a file struction /com/myproject/main, the classpath is not [directory]/com/myproject/main, but it is simply [directory].

[directory] - is the parent folder of "com". hopefully that makes sense

sillyboy 43 Practically a Master Poster

yes, the class directory is the correct classpath, but if they are in packages, make sure you reference the root folder.

sillyboy 43 Practically a Master Poster

all -d should do, is put the compiled classed in your specified directory. i am not exactly sure what you are having issues with, if you can be more specific, perhaps we can be of more help.

a classnotfound will be the result of the specific class missing from your classpath.

sillyboy 43 Practically a Master Poster

nice work, althought I wouldn't think that would cause a infinite, more likely an ArrayIndexOutOfBounds... anyway, it's solved.

sillyboy 43 Practically a Master Poster

\t = tab

sillyboy 43 Practically a Master Poster

everything within the for loop's braces are within the for loop {}. if you exclude the braces, then only a single statement is within the for loop. since you have the braces, you can place as many statements as you like within them, and they will execute with each loop (you could actually solve this issue with a single statement, but it is a little fidgety).

read what the modulus does, and it should be pretty obvious where to put it, you should only need 1 example or so.

in psuedo code you loop would probably include something like:

if the current number is a multiple of 5
  print the current number
sillyboy 43 Practically a Master Poster

yeh, so you are 50% there. now you just need a condition (e.g. if) to see if the current number is a multiple of 5 or not.

hint: modulus

sillyboy 43 Practically a Master Poster

yes i do, why don't you actually give it a shot first, and then we can help you out further.

sillyboy 43 Practically a Master Poster

have a google of "Search Engine Optimization". I don't actually know the techniques myself, but there should be plenty of tips if you dig a little.

sillyboy 43 Practically a Master Poster

yeah, it is for security, but you should be able to simply click "allow"

sillyboy 43 Practically a Master Poster

I highly doubt he wants your code to match his, the chance of code being identical is usually rare and should raise concerns of plagarism. Anyway, have you got any further?

sillyboy 43 Practically a Master Poster

Is this a programming course or a business course? If it is a programming course, I think "exactly like that" is taking him too literally, as learning looping/control is much better than trying to mimick sums (in less efficient ways). If it is a business course (or something other than programming), you need to refine your code to use a sequence, you need to take elements up to "i" not just "i". good luck

sillyboy 43 Practically a Master Poster
sum(sequence)

you are not giving it a sequence

sillyboy 43 Practically a Master Poster

hahaha this is a really unfortunate error:

while (!stop);{

notice the semicolon (hence an infinite loop of empty statement)

sillyboy 43 Practically a Master Poster

what makes you think there is such a thing as document.fontFamily?
as I said, make sure you are using up-to-date and correct properties.

sillyboy 43 Practically a Master Poster

well since background works, why not use the same location.href? You are also making use of deprecated code, you might want to rethink how you are changing the properties.

sillyboy 43 Practically a Master Poster

And you can't get access to a plug-in keyboard?

If the boot manager is any good, I would think it would have a timeout setting (so default to a certain OS).

sillyboy 43 Practically a Master Poster

The easiest solution would be to get access to a PS/2 or USB keyboard and use that. If you don't use the Ubuntu CD, won't it auto-boot into windows? (unless you have already installed it)

sillyboy 43 Practically a Master Poster

The counterfeit message will appear after a specific windows update. So even if you format, if you install the update again, it will re-appear.

sillyboy 43 Practically a Master Poster

I think you will find a math library for python (I am not 100% on this, but it would make sense). If you look through it, it will also probably have some random function. If it is like most random functions, it will probably generate something between 0-1 so you will need to do things like x10 to get values from 0-10 etc... so you will be able to manipulate the random number generator to output something useful to you. If you get stuck, I will look into it more.

sillyboy 43 Practically a Master Poster

I've replied and fixed it up for you. There were 2 issues I fixed:
1. def means defining a function, not calling, so "def main:" should only appear once in your code
2. you didn't have any function calls "main()"

So to create a function use def blah:
to call a created function use blah()