Cate van Alphen

Greenhorn
+ Follow
since Jun 16, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Cate van Alphen

Hi,

I'm having problems affecting the size of components. I have a dice object that extends JPanel and overrides the paintComponent method to display the appropriate image. I want to put several of these onto another JPanel. However the dice objects will only display a tiny bit. I have tried setSize and setMinimumSize on both the dice object, and the JPanel I'm putting them onto. It doesn't seem to make any difference.
17 years ago
My program keeps giving an OutOfMemoryError. Using -Xmx to increase the memory has been suggested, but I was wondering where to find more information about this. Specifically can this be used with an executable jar (if so how - I'm not very knowlegeable about making jar beyond following steps of a tutorial). What is an advisable amount of memory, and what will the effects be of increasing the memory and using the program on other computers. What happens to the machine if I allocate too much? Does it cause death or move on to hard drive memory?

Thanks for any info.
17 years ago
Thanks everyone. I have tried some profilers and now I'm REALLY confused! I've tried JConsole and NetBeans. I'm a bit overwhelmed with the info from NetBeans, but it seems there are a lot of int[] from BufferedImage. My program is a sort of flower hybidising thing. I have a singleton class called FlowerSimState which holds all the information, and the panels of the gui are registered as observers. What's really confusing me is that if I press the button with the OffspringListener repeatedly (50 times), the memory usage constantly increases untill it dies. If I press the RandomListener button the memory fluctuates, but it calls the same function as the OffspringListener! If I press other buttons, the OffspringListener still kills the program but at a less predicatable rate.

I've included some code, but it's not all there as I tried to simplify to make it more readable. I only realise how confusing my code is when I try to explain it to someone else.











17 years ago
Hi,

My program keeps giving an OutOfMemoryError. I was wondering if there were any tips to find out where the memory is going. I can't seem find a pattern to when it gives up the ghost. I have put a Static count variable into each of my classes which increments in the constructor and takes off one in the finalize method and prints out the count. This seems to be behaving as I expected ie. there is the correct number of each of my objects.

Thanks
17 years ago
Thanks. I'm a bit confused about where the .values() comes from. In the api I can find an abstract class Enum, but you declare an enum, is this different, and if so where do I find info about it? Is X.values() an array of the enum X?
17 years ago
Hi,

What I am trying to do is get a random element out of an enum, the array equivalent is:


I found enum has an ordinal() function that returns its position in its enum declaration, but I can't figure out how to get an object out using the position. The best I've come up with is this, given an enum called Season:



which seems terribly clunky, I wondered if there was an easier way.
17 years ago
Me and my K&B book are exhausted! I was getting 70ish percent on the mocks, so I'm really pleased. The day before I did the test I did the 2nd free Learnkey exam and failed because the pass mark was set to 80% I nearly had a melt down!

I found I was most comfortable with the D&D questions, and it warned me that I would have to do the question again if I reviewed it, so that wasn't as bad as I expected.

I used the K&B book, the Learn Key mocks that come with that and Examulator http://www.examulator.com/phezam/login.php (at least 20 questions per day).

For a basic study tip, I was having trouble remembering stuff untill I wrote out my own notes (on paper not pc) using many coloured pens.

Thanks to K&B, and javaranch for being a nice place.
17 years ago
I'm in the UK. I booked my test using Prometric's website (which is extremely irritating). I turned up for my test today, fairly highly strung with nerves, and the college has not been registered with Prometric for 8 weeks! They stopped doing Prometric tests because of all the admin mess-ups. I was the 2nd candidate to turn up today! So, don't use the website, and maybe phone the actual college to check up too.
After much muddling about with looking at Prometric's website and then Sun's, I ordered an paid for my voucher using a credit card - got an email with voucher number as N/A and expiry as N/A. I thought myabe I was supposed to wait for a paper voucher - nothing happened. I contacted Sun and they said there was a problem reigistering my name and I couldn't use the website so I had to phone. Phoned and got sent an email with the exam voucher number which I used to book my exam. I haven't been sent anything in the mail yet. I'm in UK.
Thanks. I have paid. For some reason I expected just to be sent a number that I could book an exam with immediately. Too used to digital transactions I suppose... Must be patient then :roll:
Hi,

I have purchased a voucher from sun and registered a new student account. The receipt they emailed me has N/A for the voucher number. Am I waiting for an actual voucher to arrive by snail mail? I'm having a bit of a panic because when I logged in to Sun's site again my student number was changed and there's nothing under "order status".

I've emailed sun (no response) and also looked through certification FAQ here and on Sun's site. Hope I'm not being too thick.
I'm going for Java 5 because it's the latest and I didn't know any better. However if 1.5 is widely considered to be more difficult than 1.4 it is probably worth more anyway.
"Purchase a voucher for most Java technology or Solaris OS certification exams between July 1 and August 15, 2006, and should you need it, you can take the exam one additional time for free. The retake exam must be taken by August 15, 2007 the following year. This offer is available in most countries around the world."

http://www.sun.com/training/savings/retake.xml