Applet performance issue

All,

I have designed a dynamic matrix which creates text boxes according rows and columns. I used GridLayout and Panel to design this matrix. When I try to execute this applet with 20x20 (400 text boxes) it comes out in 7 seconds.

But when I try to execute the same applet with 25x25, this takes more than 25 seconds and we could see the drawing text boxes column wise. It looks quite awkward. We tried with JscrollPane. This also does the same thing.

So, I just want to make sure is there any other way to improve the performance & speed of this applet.

Your help is highly appreciated.

Thanks,

Sriram.

[662 byte] By [bazhg2n] at [2007-9-26 2:48:41]
# 1

Hi! Sounds like you're adding the text boxes to a Panel object. Try this - make the Panel invisible by calling setVisible(false) on it prior to adding the text boxes. Call setVisible(true), followed by paint() on it after you're done adding the text boxes. Check if the performance has improved.

Hope this helps!

Cheers!

amolk at 2007-6-29 10:34:11 > top of Java-index,Desktop,Core GUI APIs...
# 2

It seems like you are trying to make a grid component.

Search for grids on the internet!

If you choose to design your own, you should reconsidder your design. A grid needs only one TextField! In a 25*25 grid, use a panel drawing the text of every cell and the lines between them in the paint method of the panel. Then when you activate a specific cell for editing (only one cell can be active at any given time) you add the TextField, force it to be layed out in that specific cell, set the text and you are ready for cell editing...

If you do it right, the speed will be no problem.

";-)

Ragnvald Barth

Software engineer

Ragnvald at 2007-6-29 10:34:11 > top of Java-index,Desktop,Core GUI APIs...