Problem about reshape
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, May 16, 2002 07:58 PM

HI, Here Have a question about reshape: I Have Create a Panel pPanel, and two child panel C1 and C2. These twochild panel will be drawed inside the pPanel. When I click on the certain button. I want C1 and C2 resahpe. I have the following code: ImagePanel c1 =null; ImagePanel c2 =null; public void pPanel(image1, image2){ setLayout(new BorderLayout()); Panel page = new Pane(); page.setLayout(null); c1= new ImagePanel(image1); c2= new ImagePanel(image2); page.add(c1); page.add(c2); c1.reshape(0,0,100,100); c2.reshape(0,100,200,200); } When click on certain button: Event{ …    More>>

HI,
Here Have a question about reshape:
I Have Create a Panel pPanel, and two child panel C1 and C2. These twochild panel will be drawed inside
the pPanel. When I click on the certain button. I want
C1 and C2 resahpe.

I have the following code:

			
ImagePanel c1 =null;
ImagePanel c2 =null;
public void pPanel(image1, image2){

setLayout(new BorderLayout());
Panel page = new Pane();
page.setLayout(null);
c1= new ImagePanel(image1);
c2= new ImagePanel(image2);
page.add(c1);
page.add(c2);
c1.reshape(0,0,100,100);
c2.reshape(0,100,200,200);

}
When click on certain button:
Event{
…
c1.reshape(0,0,200,200);
c2.reshape(0,200,100,100);
}

The area of both c1 and c2 was reshaped to the area I wish it to display.
But the content isn’t. The extra area I reshape on event display with gray color.
Which mean it the panel c1 and c2’s content cannot fit too new area. How can I
Fit the content to new area as well???
I try to deburg the problem, When since the content I drawed by my code, I found that the area I get
is increase and the line I drawed in the coded in changed as I desired. But the out put keep the orginal
one. It seems The page with setlayout (null) restrict the display area even content of c1 changed.

In the code, some some them are depreciated. But the program is in operation saftly, so my company won't
to change. So I still need to use old J++ 1.1 complier.

Is there any method to reconstruct the layout in
public void pPanel(image1, image2){
}
If can, maybe easier to solve the problem.

If any body can help . It will be very great!It is quite hurry.

Thanks in advance.    <<Less
About | Sitemap | Contact