S
steve
Hi,
I have a jframe that adds a jpanel.
the jpanel holds a number of buttons at the bottom.
and above them a jpanel ,that is set to card layout.
final static String DISPLAYPANEL = "DispayNotes";
final static String EDITPANEL = "EditNotes";
JPanel container = new JPanel(new CardLayout());
JPanel Card1Root = new Card1();
JPanel Card2Root = new Card2();
in my init code i have
container.add(Card1Root, DISPLAYPANEL);
container.add(Card2Root, EDITPANEL);
this.setLayout(flowLayout1);
this.add(container, null);
this.add(buttonbox, null);
the switch cod is:
void showthecaf() {
// Card1Root.setVisible(false);
CardLayout cl = (CardLayout) (container.getLayout());
cl.show(container, EDITPANEL); //flip to the new screen
}
the problem is that whenever i switch to the second card, if i deselect the
window & reselect it
or drag another window over it,
then card 1 shows thru as well as card 2
if i then slightly re-size the window, then the display "rights" it's self
again.
but card 2 never shows thru on card 1.
the cards are setup as separate classes as in separate .jar files.
public class Card2 extends JPanel {}
public class Card1 extends JPanel {}
any ideas?
steve
I have a jframe that adds a jpanel.
the jpanel holds a number of buttons at the bottom.
and above them a jpanel ,that is set to card layout.
final static String DISPLAYPANEL = "DispayNotes";
final static String EDITPANEL = "EditNotes";
JPanel container = new JPanel(new CardLayout());
JPanel Card1Root = new Card1();
JPanel Card2Root = new Card2();
in my init code i have
container.add(Card1Root, DISPLAYPANEL);
container.add(Card2Root, EDITPANEL);
this.setLayout(flowLayout1);
this.add(container, null);
this.add(buttonbox, null);
the switch cod is:
void showthecaf() {
// Card1Root.setVisible(false);
CardLayout cl = (CardLayout) (container.getLayout());
cl.show(container, EDITPANEL); //flip to the new screen
}
the problem is that whenever i switch to the second card, if i deselect the
window & reselect it
or drag another window over it,
then card 1 shows thru as well as card 2
if i then slightly re-size the window, then the display "rights" it's self
again.
but card 2 never shows thru on card 1.
the cards are setup as separate classes as in separate .jar files.
public class Card2 extends JPanel {}
public class Card1 extends JPanel {}
any ideas?
steve