Package java.awt

Examples of java.awt.CardLayout


        connectPanel.add(this.connectButton);
                       
        this.manageSubscriptionsPanel = new JPanel(new BorderLayout(3,3));
        this.manageSubscriptionsPanel.setBorder(BorderFactory.createTitledBorder("Manage Subscriptions:"));
       
        this.mainPanelCardLayout = new CardLayout();
        this.mainPanel = new JPanel(this.mainPanelCardLayout);
        this.mainPanel.add(this.notConnectedLabel, Boolean.FALSE.toString());
        this.mainPanel.add(this.manageSubscriptionsPanel, Boolean.TRUE.toString());
               
        this.subscriptionList = new JList();
View Full Code Here


    this.generatePanel = new GeneratePanel();
    JPanel emptyPanel = new JPanel();
    emptyPanel.setName("empty");

    this.workPanelLayout = new CardLayout();
    p = new JPanel(this.workPanelLayout);

    p.add(emptyPanel, "empty");
    this.generatePanel.getPanel().setName("generatePanel");
    p.add(this.generatePanel.getPanel(), "generatePanel");
View Full Code Here


      // add component
      containerPanel.add(instance.getComponent(), className);

      CardLayout cl = (CardLayout) containerPanel.getLayout();

      cl.show(containerPanel, className);


      return instance.getComponent();
    }
    catch(Exception e)
View Full Code Here

  public ContainerPanel()
  {
    super();

    cl = new CardLayout();

    this.setLayout(cl);
  }
View Full Code Here

    /**
     * Default constructor.
     */
    public JThermometer() {
        super(new CardLayout());
        this.plot.setInsets(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
        this.data = new DefaultValueDataset();
        this.plot.setDataset(this.data);
        this.chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT,
                this.plot, false);
View Full Code Here

               

                startupBackend.setNameText(enterNameTextField.getText());
                if(startupBackend.canPressNextButton()){
                myCD.add(new RationsPaceFrame(myGameControl, myCD, "Startup"), "name_1317840867491837000");
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);
                }
                    //cd.next(contentPane);
                    //selectedProfession - the String selected profession
                    //name = player name, can't be empty or null
                    //additionalPlayers - array that holds the additional players, null if empty
View Full Code Here

       
        JButton button = new JButton(invFrameBackend.getBackButtonText());
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                myCD.add(new TakingMoveFrame(gameControl, myCD, "Inventory"), "TakeMove");
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);
            }
        });
        button.setBounds(36, 277, 89, 23);
        add(button);
       
        JButton btnSavebutton = new JButton(invFrameBackend.getSaveButtonText());
        btnSavebutton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
                try {
                    myCD.add(new SaveGameFrame(gameControl, myCD), "TakeMove");
                } catch (ClassNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);
            }
        });
        btnSavebutton.setBounds(141, 277, 89, 23);
        add(btnSavebutton);
       
        JButton skillsButton = new JButton(invFrameBackend.getSkillsButtonText());
        skillsButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                myCD.add(new SkillFrame(gameControl, myCD), "Inv");
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);
            }
        });
        skillsButton.setBounds(36, 246, 89, 23);
        add(skillsButton);
    }
View Full Code Here

    JLabel lblBigJlabelDescribing = new JLabel(eventFrameBackend.getMessage());
   
    JButton btnNewButton = new JButton("Continue");
    btnNewButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        CardLayout cd = (CardLayout) myCD.getLayout();
        myControl.setNextEvent(new Event());
       
        myCD.add(new TakingMoveFrame(myControl, myCD, "Event"), "takeMove");
        cd.last(myCD);
       
      }
    });
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
View Full Code Here

               

               
                storeBackend.pressNextButton();
                myCD.add(new TakingMoveFrame(myGameControl, myCD, "Store"), "name_131784086749183704");
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);

            }
        });
       
        storeBackButton = new JButton(storeBackend.getBackButtonText());
        storeBackButton.setBounds(247, 328, 87, 23);
        storeBackButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                storeBackend.pressBackButton();
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.previous(myCD);
            }
        });
       
        engineTextField.getDocument().addDocumentListener(this);
        foodTextField.getDocument().addDocumentListener(this);
View Full Code Here

       
        JButton btnBack = new JButton("Back");
        btnBack.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                myCD.add(new InventoryFrame(gameControl, myCD), "TakeMove");
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);
            }
        });
        btnBack.setBounds(77, 266, 89, 23);
        add(btnBack);
       
        JButton btnLoad = new JButton("New Save");
        btnLoad.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                try {
                    GameSave saveGame = new GameSave();
                    saveGame.saveGame(gameControl, gameControl.getPlayer().getName());
                } catch (ClassNotFoundException s) {
                   
                    s.printStackTrace();
                } catch (IOException s) {
                   
                    s.printStackTrace();
                }
                try {
          myCD.add(new SaveGameFrame(gameControl, myCD), "TakeMove");
        } catch (ClassNotFoundException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        } catch (IOException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);
            }
        });
        btnLoad.setBounds(176, 266, 89, 23);
        add(btnLoad);
       
        JButton btnNewButton = new JButton("Overwrite");
        btnNewButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
               
                //Control loadedGame = new Control();
                int selectedIndex = list.getSelectedIndex();
                String[] saveFile = new String[2];
                try {
                    if(selectedIndex >= 0){
                        saveFile = saveGame.listOfEntries()[selectedIndex].split(" ");
                        String saveName = "";
                        String saveDate = "";
                        int count = 0;
                        for(String word: saveFile){
                            if(count < saveFile.length - 2){
                                saveName += word;
                                if(count < saveFile.length - 3){
                                    saveName += " ";
                                }
                            } else {
                                saveDate += word;
                                if(count < saveFile.length - 1){
                                    saveDate += " ";
                                }
                            }
                            count++;
                        }
                        saveFile[0] = saveName;
                        saveFile[1] = saveDate;
                    }
                            //This assumes the name is not two words
                } catch (ClassNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }
                try {
                    if(selectedIndex >= 0){
                        saveGame.overwriteGame(saveFile[0], gameControl, saveFile[1]);
                    }
                } catch (ClassNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }
                try {
          myCD.add(new SaveGameFrame(gameControl, myCD), "TakeMove");
        } catch (ClassNotFoundException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        } catch (IOException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
                CardLayout cd = (CardLayout) myCD.getLayout();
                cd.last(myCD);
            }
        });
        btnNewButton.setBounds(275, 266, 89, 23);
        add(btnNewButton);
       
View Full Code Here

TOP

Related Classes of java.awt.CardLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.