Examples of CardLayout


Examples of java.awt.CardLayout

      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setSize(640, 200);
      setLocationRelativeTo(null);

      Container contentPane = getContentPane();
      cardLayout = new CardLayout();
      contentPane.setLayout(cardLayout);
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "progress");
        panel.add(new JLabel("Connecting to " + host + "..."));
View Full Code Here

Examples of java.awt.CardLayout

      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setSize(640, 200);
      setLocationRelativeTo(null);

      Container contentPane = getContentPane();
      cardLayout = new CardLayout();
      contentPane.setLayout(cardLayout);
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "progress");
        panel.add(new JLabel("Connecting to " + host + "..."));
View Full Code Here

Examples of java.awt.CardLayout

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(upper, BorderLayout.CENTER);
    getContentPane().add(lower, BorderLayout.SOUTH);

    final CardLayout cardLayout = new CardLayout();
    main.setLayout(cardLayout);

    // ----------------------------------------------------------------
    // Add tabs to tabbed here. Remember, tabs must implement PrefsTab.
    // ----------------------------------------------------------------
    ArrayList<PrefsTab> tabs = new ArrayList<PrefsTab>();
    tabs.add(new GeneralTab(frame, prefs));
        tabs.add(new FileTab(frame, prefs));
        tabs.add(new EntryEditorPrefsTab(frame, prefs));
        tabs.add(new GroupsPrefsTab(prefs));
    tabs.add(new AppearancePrefsTab(prefs));
    tabs.add(new ExternalTab(frame, this, prefs, parent.helpDiag));
    tabs.add(new TablePrefsTab(prefs, parent));
    tabs.add(new TableColumnsTab(prefs, parent));
    tabs.add(new TabLabelPattern(prefs, parent.helpDiag));
    tabs.add(new PreviewPrefsTab(prefs));
    tabs.add(new NameFormatterTab(parent.helpDiag));
    tabs.add(new XmpPrefsTab());
        tabs.add(new AdvancedTab(prefs, parent.helpDiag));
   
    Iterator<PrefsTab> it = tabs.iterator();
    String[] names = new String[tabs.size()];
    int i = 0;
        //ArrayList<Component> comps = new ArrayList<Component>();
        while (it.hasNext()) {
      PrefsTab tab = it.next();
      names[i++] = tab.getTabName();
      main.add((Component) tab, tab.getTabName());
        }

    upper.setBorder(BorderFactory.createEtchedBorder());

    chooser = new JList(names);
    chooser.setBorder(BorderFactory.createEtchedBorder());
    // Set a prototype value to control the width of the list:
    chooser.setPrototypeCellValue("This should be wide enough");
    chooser.setSelectedIndex(0);
    chooser.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    // Add the selection listener that will show the correct panel when
    // selection changes:
    chooser.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        if (e.getValueIsAdjusting())
          return;
        String o = (String) chooser.getSelectedValue();
        cardLayout.show(main, o);
      }
    });

    JPanel one = new JPanel(), two = new JPanel();
    one.setLayout(new BorderLayout());
View Full Code Here

Examples of java.awt.CardLayout

           
            ButtonGroup bg = new ButtonGroup();
            bg.add(rbStatic);
            bg.add(rbDynamic);
           
            final JPanel cardPane = new JPanel(new CardLayout());
           
            Box vbox = Box.createVerticalBox();
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(" "));
View Full Code Here

Examples of java.awt.CardLayout

    public StackPanel(PageListModel model){
        this.model =  model;
      
   
        // content
        content = new JPanel(new CardLayout());

        // tabs
        tabsPanel = new GridBagPanel();
        tabs = new ArrayList();
View Full Code Here

Examples of java.awt.CardLayout

            selectedPage.setBorder(pm.getPageTitle());
        }
      

        // Update content
        CardLayout cl = (CardLayout) (content.getLayout());
       
        if (pm != null){
            cl.show(content, pm.getPageTitle());
        } else {
            cl.show(content, "emptyPanel");
        }

        // Update tags status
        for(int i=0;i<tabs.size();i++){
            ((JButton)tabs.get(i)).setBackground(null);
View Full Code Here

Examples of java.awt.CardLayout

        content.add(inner, BorderLayout.CENTER);

        // template card panel
        templatesPanels = new JPanel();
        templatesPanels.setLayout(new CardLayout());

        inner.add(templatesPanels, BorderLayout.CENTER);
       
      
        tlist = new JList(new TemplateListModel());
View Full Code Here

Examples of java.awt.CardLayout

   
   
    private void displayTemplate(Template t) {
        if (t != null){
            CardLayout cl = (CardLayout) (templatesPanels.getLayout());

            if ( t.getOptionPanelForTemplate() != null ){
                cl.show(templatesPanels, t.getName());
            } else {
                cl.show(templatesPanels,"emptyPanel");
            }

            headerPanel.setTitle(t.getName());
            headerPanel.displayInfo(t.getTemplateInformation());
        }
View Full Code Here

Examples of java.awt.CardLayout

      CyclicNumberAxis cna = null;
      if (plot.getDomainAxis() instanceof CyclicNumberAxis) cna = (CyclicNumberAxis)plot.getDomainAxis();
     
      panel.add(cbcyclex = new ActionCheckBox(resources.getString("CyclicAxis"), cna!=null) {
        public void actionPerformed(ActionEvent e) {
          CardLayout cl = (CardLayout)(xcards.getLayout());
          if (isSelected()) cl.show(xcards, "cyclic");
          else cl.show(xcards, "normal");
        }
      });
      panel.add(cbinvertx = new ActionCheckBox(resources.getString("Inverted"), plot.getDomainAxis().isInverted()) {
        public void actionPerformed(ActionEvent e) {
        }
      });
      section.add(panel);
     
      xcards = new JPanel();
      xcards.setLayout(new CardLayout());
     
      Box hbox = Box.createHorizontalBox();
      hbox.add(new JLabel(resources.getString("Period")));
      hbox.add(nfperiodx = new NumberField(cna==null ? 0 : cna.getPeriod()));
      hbox.add(Box.createHorizontalGlue());
      hbox.add(new JLabel(resources.getString("Offset")));
      hbox.add(nfoffsetx = new NumberField(cna==null ? 0 : cna.getOffset()));
      xcards.add(hbox,"cyclic");
     
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      double autorange = plot.getDomainAxis().getFixedAutoRange();
      panel.add(cbfixedautox = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
        public void actionPerformed(ActionEvent e) {
          nffixedautox.setEnabled(isSelected() && isEnabled());
        }
      });
      panel.add(nffixedautox = new NumberField(autorange,10));
      xcards.add(panel,"normal");

      section.add(xcards);
     
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(cbautox = new ActionCheckBox(resources.getString("Auto-update"), plot.getDomainAxis().isAutoRange()) {
        public void actionPerformed(ActionEvent e) {
          cbfixedautox.setEnabled(isSelected());
          cbfixedautox.apply();
          lpxmin.setEnabled(!isSelected());
          lpxmax.setEnabled(!isSelected());
          tfpxmin.setEnabled(!isSelected());
          tfpxmax.setEnabled(!isSelected());
        }
      });
      panel.add(lpxmin = new JLabel(resources.getString("minLabel")));
      panel.add(tfpxmin = new NumberField(10));
      tfpxmin.setValue(plot.getDomainAxis().getLowerBound());
      panel.add(lpxmax = new JLabel(resources.getString("maxLabel")));
      panel.add(tfpxmax = new NumberField(10));
      tfpxmax.setValue(plot.getDomainAxis().getUpperBound());
      cbautox.apply();
      section.add(panel);
     
      content.add(section);

     
      // Now handle Y axis
      section = new Box(BoxLayout.Y_AXIS);
      section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("YAxis")));

      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
     
      cna = null;
      if (plot.getRangeAxis() instanceof CyclicNumberAxis) cna = (CyclicNumberAxis)plot.getRangeAxis();
     
      panel.add(cbcycley = new ActionCheckBox(resources.getString("CyclicAxis"), cna!=null) {
        public void actionPerformed(ActionEvent e) {
          CardLayout cl = (CardLayout)(ycards.getLayout());
          if (isSelected()) cl.show(ycards, "cyclic");
          else cl.show(ycards, "normal");
        }
      });
      panel.add(cbinverty = new ActionCheckBox(resources.getString("Inverted"), plot.getRangeAxis().isInverted()) {
        public void actionPerformed(ActionEvent e) {
        }
      });
      section.add(panel);
     
      ycards = new JPanel();
      ycards.setLayout(new CardLayout());
     
      hbox = Box.createHorizontalBox();
      hbox.add(new JLabel(resources.getString("Period")));
      hbox.add(nfperiody = new NumberField(cna==null ? 0 : cna.getPeriod()));
      hbox.add(Box.createHorizontalGlue());
View Full Code Here

Examples of java.awt.CardLayout

           
            ButtonGroup bg = new ButtonGroup();
            bg.add(rbStatic);
            bg.add(rbDynamic);
           
            final JPanel cardPane = new JPanel(new CardLayout());
           
            box = Box.createHorizontalBox();
            box.add(bufferLabel = new JLabel(resources.getString("staticBufferLabel")));
            box.add(Box.createHorizontalGlue());
            box.add(nfSize = new NumberField(100,5));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.