Re: CardLayout() not working



On 2008-04-24, michael.miceli88@xxxxxxxxx <michael.miceli88@xxxxxxxxx> wrote:
I am trying to get it to where if the user selects new it will change
the panel, but it isn't working at all. Nothing changes, but I know
the event method is getting called, because of a print statment.

[code]
private void jMenuItemNewActionPerformed(java.awt.event.ActionEvent
evt) {
java.awt.CardLayout cl = (CardLayout)jPanelMain.getLayout();
String path = "jPanelPagePageWelcome";
cl.show(jPanelMain,path);
System.out.println(path);
}
[/code]
That is where I try to use the cardlayout. The rest of the code is
below

In the snipped code there were statements like

jPanelMain.add(jPanelPageWelcome, "card2");
jPanelMain.add(jPanelPageNew, "card3");

that added panels with tags "card2" and "card3", but a panel with
the tag "jPanelPagePageWelcome" was not added.
.



Relevant Pages

  • Re: CardLayout() not working
    ... the event method is getting called, because of a print statment. ... private void jMenuItemNewActionPerformed(java.awt.event.ActionEvent ... In the snipped code there were statements like ...
    (comp.lang.java.help)
  • Re: CardLayout() not working
    ... the event method is getting called, because of a print statment. ... private void jMenuItemNewActionPerformed(java.awt.event.ActionEvent ... In the snipped code there were statements like ...
    (comp.lang.java.help)
  • RE: Cant update foreground panel from background thread
    ... you cannot update a control from a thread that did not create the control. ... In your case you are adding the labels to the panel from a different thread ... void private void backgroundWorker1_DoWork ... Label label1 = new Label; ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Binding custom list of usercontrols?
    ... collection and want the Panel to create a UserControl for each business ... You set up data binding between the UserControl ... and the corresponding business object. ... private void RearrangeTextBoxes() ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Which pattern for Settings/Preferences/Options scenario?
    ... Adds the given option's alternatives to the given panel. ... private void addOption{ ... presented as a check-button selection. ... @return namespace text display choices ...
    (comp.object)