Login  Register

Re: question about adding component to a ImageWindow

Posted by Patrick Pirrotte on Oct 07, 2008; 7:27am
URL: http://imagej.273.s1.nabble.com/question-about-adding-component-to-a-ImageWindow-tp3694834p3694835.html

Hi Xin,

If you want to extend ImageWindow or ImageCanvas you need to stay in AWT.
Try replacing JTextPane by java.awt.TextArea.

You can't mix heavyweight components (such as AWT) with lightweight
components (such as Swing). As ImageJ is written in AWT, inside Frames such
as ImageWindow/ImageCanvas only AWT components get correctly drawn. You can
put Swing components into a separate JFrame though, and several plugins do
so to profit from the larger component library offered by javax.swing.*.

Regards,

Patrick

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of xin
zhang
Sent: 07 October 2008 00:03
To: [hidden email]
Subject: question about adding component to a ImageWindow

Hi,

I am trying to add a TextPanel to an ImageWindow, however, no matter how do
I set the size of the TextPanel, I always get tiny TextPanel as shown at
http://terpconnect.umd.edu/~zhangx/imagej/nanoscopeiiireader/Picture-2.png

Has anybody any idea how to make the TextPanel take the whole width of the
window?

Thanks in advance.

Xin

--
***********************************************
Xin Zhang
Graduate Student
Department of Materials Science and Engineering University of Maryland at
College Park
Tel: (301)405-0900
Email: [hidden email], [hidden email]
Web:http://www.glue.umd.edu/~zhangx/
***********************************************