Re: JLabels Are Big
- From: Mark Space <markspace@xxxxxxxxxxxxxx>
- Date: Tue, 04 Mar 2008 22:00:19 GMT
Jason Cavett wrote:
noticing is that JLabels chew up memory. If 20 or more tokens are
created (which is quite possible given the functionality of the
application), memory starts loading up and the application bogs down.
I agree with Daniel, 20 labels is not a lot. You likely have some other resource issue here. Better fix that first.
2. I could also write a JPanel of sorts and have it render its text
directly in the panel rather than through the JLabels. Then, when the
user clicked the JPanel, I would have to do the work to check where
This is more or less what I would do. Create your own java.awt.Component that just displays what you want. You might be able to subclass Image and then just draw the formula with Graphics2D operations, and then update in the usual way for Images.
However, you might check out JEditorPane. It might be possible to compose your formula in HTML, and then just use setText. HTML also might be more portable. JEditorPanes are already editable, so you might be able to leverage that instead of do the all the code for editing from mouse click and keyboard presses yourself.
.
- Follow-Ups:
- Re: JLabels Are Big
- From: Jason Cavett
- Re: JLabels Are Big
- References:
- JLabels Are Big
- From: Jason Cavett
- JLabels Are Big
- Prev by Date: Re: Java DB, is it for small databases only?
- Next by Date: Re: Web Spider
- Previous by thread: Re: JLabels Are Big
- Next by thread: Re: JLabels Are Big
- Index(es):
Relevant Pages
|
|