sillyboy 43 Practically a Master Poster

if you are debugging your app, i assume you have some breakpoints defined. are you hitting one of these breakpoints and not knowing it? make sure you step past any breakpoints you may have. if you are querying for user inputs, it would be logical to have prompts so the user knows when to input values too.

sillyboy 43 Practically a Master Poster

jdb says? or prog says? does prog accept arguments when called or when during execution?

do you actually call run to start prog execution?

sillyboy 43 Practically a Master Poster

you've got it easy, all you need to do is watch your classmate get the answers and use them yourself. a heart isn't enough to make me want to do that assignment either :)

sillyboy 43 Practically a Master Poster

the most common way to pass values between objects is to simply create getter methods. we can be of more help if you give more specific issues, otherwise it just sounds like you want us to do you assignment for you.

sillyboy 43 Practically a Master Poster

i believe bestjew is correct, but more importantly, what is "<\description>"? my guess is it is comming from XML, but that is not correct, do you want "</description>" instead?

sillyboy 43 Practically a Master Poster

Texas is the Reason - A Jack With One Eye

favourite song ever.

sillyboy 43 Practically a Master Poster

what kind of application are you talking about? generally you would need to create a new instance with the updated jar, as you have mentioned.

sillyboy 43 Practically a Master Poster

in the constructor of away, save the instance of other. in the same way as away, you can have this.other, and access its methods like that.

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

i don't think it matters greatly how you set out your XML as long as you can parse it correctly. in saying that, i would probably avoid appending the numbers on "row" / "column" and instead just use the natural ordering to produce your level layout. if you do this, it will also mean your level is not tied down to a specific size.

sillyboy 43 Practically a Master Poster

you cannot expect to post your assignment and get a solution. please use code tags, and identify the relevant code to post.

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

i'm not 100% on this, but unfortunately there is no such thing as a "random number", progmatically anyway. there is something something called a "seed" involved to start a chain of "random" numbers. i think what is happening here, is you are generating the 1st random number multiple times...

what you want to do is to move the initialisation of "generator" so that there is a chance for nextInt to do its thing and generate.

does this make sense?

sillyboy 43 Practically a Master Poster

I assume you are able to copy this using explorer? anyway, look up the api on how to use the copytree method.

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

// call calculateInventory method
public static double calculateInventory(product[])

this is not how you "call" a method, this is a method definition.

sillyboy 43 Practically a Master Poster

you are returning, so when will it ever get to MakeBooking?

sillyboy 43 Practically a Master Poster

how else were you thinking of doing this? of course you can do what you have explained. imagine if buttons didn't have "custom" events...

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

from my previous post: "have you really initialised cArray?"

this is not a Circle object, but an array. you have declared it as an array, but never initialised it as one. what size is the array?

when you are trying to put values into this non-existant array, it can't do anything, so far cArray is just null.

sillyboy 43 Practically a Master Poster

am i missing your initialisation, where is it? (there is a difference between a declaration and initialisation)

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

(Collection.java:21) cArray[count] = new Circle(left,top,radius);

is where you are getting the null pointer. have you really initialised cArray?

sillyboy 43 Practically a Master Poster

you cannot just define variables, you need to initialise them too.

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

if you are reading a book, doesn't it contain questions? I think a text book is probably the best place to get problems to practice on, as it will probably provide sample implementations and explain good/bad practices within the implementation.

sillyboy 43 Practically a Master Poster

what permission error does it give? and only on windows?

from the api, copy should only have a file as its source so you shouldn't be able to copy folders using it. maybe shutil.copytree is what you are looking for?

sillyboy 43 Practically a Master Poster

use code tags, and can you actually copy the section of the stack trace. if it is repeated, 1 instance is enough.

sillyboy 43 Practically a Master Poster

your code execution starts from while True: (and since you had #main, it seems you understand that). read your code from that point onwards, where ever would health change?

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

where do you call your functions?

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

what you have there doesn't explain a whole lot...

sillyboy 43 Practically a Master Poster

should use [] for code tags...

anyway, it's hard to read but i think need to create a proper constructor for matrix. you cannot use an array like a vector.

sillyboy 43 Practically a Master Poster

"value is2" where does this come from?

your code above has nothing about this...

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

you need to find a more appropriate listener (i.e. NOT ListSelectionListener).

edit: you could also try look at ListSelectionEvent, and filter out the event you don't want.

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

... if you initialise your moneyLowest to a large number (just choose some max), can you simply use the code I posted earlier.

e.g. moneyLowest = 1000

the user then start donating money, and so this 1000 should get overwritten the first time a deposit is made (since this is a MAX value). with the condition you introduce, only smaller subsequent values are stored and so there is no need to "remember" any previous value...

as i said, this is exactly what you do with highest, with a greater than symbol, not less than...

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

what is your error?

sillyboy 43 Practically a Master Poster

how did you work out how to do the highest? it is exactly the same...

surely the condition of moneyLowest > money stops moneyLowest to be the current user input (unless infact it is the lowest). one condition is enough to make this work.

"how do I go back to the previous numbers from the earlier inputs" do you do this for moneyHighest? if yes/no how do you make lowest do the same?