Need a bit of help

classic Classic list List threaded Threaded
2 messages Options
Ana Osorio Ana Osorio
Reply | Threaded
Open this post in threaded view
|

Need a bit of help

Hi,
 
I'm a spanish student. I'm developing a math aplication and I want to show some complex equations with some dynamical parameters. I think your library is great for me, but I'm having problems to 'draw' the images in the screen. I've looked at the examples and the Server Usage example that it's at the web, and I see that it creates a bufferedImage and use a label, but then I can't get show this on screen.
 
I'm sorry if this is a too easy question, but I've tried everything I could think and it didn't work.
 
Thank you so much for your help, and sorry if my english it's no so good.
 
Ana.
Calixte Denizet-2 Calixte Denizet-2
Reply | Threaded
Open this post in threaded view
|

Re: [jlatexmath] Need a bit of help

Le jeudi 30 septembre 2010 à 20:21 +0200, Ana Osorio a écrit :
> Hi,

Hello Ana

>  
> I'm a spanish student. I'm developing a math aplication and I want to
> show some complex equations with some dynamical parameters. I think
> your library is great for me, but I'm having problems to 'draw' the
> images in the screen. I've looked at the examples and the Server Usage
> example that it's at the web, and I see that it creates a
> bufferedImage and use a label, but then I can't get show this on
> screen.

For example:

String latex = "\\frac\\pi4";
TeXFormula formula = new TeXFormula(latex);
TeXIcon latexIcon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY,
20);

TeXIcon object implements Icon interface
(http://download-llnw.oracle.com/javase/6/docs/api/javax/swing/Icon.html )

If you to paint the icon in a JPanel, you can extend JPanel and overload
paintComponent:

public void paintComponent(Graphics g) {
    super.paintComponent(g);
    latexIcon.paintIcon(this, g, 100, 100);
}

>  
> I'm sorry if this is a too easy question, but I've tried everything I
> could think and it didn't work.
>  
> Thank you so much for your help, and sorry if my english it's no so
> good.

Your english cannot be worse than mine.

>  
> Ana.

Calixte