resize ImageWindow

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

resize ImageWindow

Michael Strupp
Hello Imagej Community

I have a class that extended the ImageWindow class. In that ImageWindow I display an ImageCanvas and a panel with buttons.
In the canvas of that window I display different ImagePlus objects. It works ok when the ImagePlus objects have the same size, but when I open an Image with different size the panel with the buttons does not get displayed in the window anymore.

Here is some code from the constructor. Probably I made an mistake, because I don't have much experience with layout managers.



this.setLayout(new GridBagLayout());
this.cbg = new GridBagConstraints();

this.cbg.anchor = GridBagConstraints.CENTER;
this.cbg.gridx = 0;
this.cbg.gridy = 0;
this.cbg.insets = new Insets(10, 10, 10, 10);

this.imp.getCanvas().setBounds(0, 0, 800, 600);
this.add(this.imp.getCanvas(), this.cbg);

this.cbg.gridx = 0;
this.cbg.gridy = 1;
       
this.add(this.panel, this.cbg);

this.pack();
this.setVisible(true);



When an object is created, I display other ImagePlus objects with,




BufferedImage bi = this.createImage();
               
try
{
        this.imp.setImage( bi );
}
catch(Exception e)
{
        e.printStackTrace();
}

It would be nice when someone could help me with that problem.

Kind regards,

Michael


--
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a