/*
  This file was "HTMLized" by VasJava2HTML.
  For more information visit VasJava2HTML page
  (C) 1997, 1998, 1999, 2000 Vasile Calmatui
*/
/**************************************************************\
* Copyright (C) 1997 - 2001 Vasile CALMATUI                    *
*                                                              *
* This software is public domain. Permission is granted to     *
* use, copy and modify this software to anyone.                *
****************************************************************
* Please don't contact me for information, bugs, comments, job *
* offers. If you like this software, please send a postcard to *
* the following address:                                       *
* Vasile CALMATUI                                              *
* 35 str. Burebista                                            *
* 3600 Ungheni                                                 *
* MOLDOVA                                                      *
****************************************************************
* The author is not liable for damages resulting from  the use *
* of this software or its derivates.                           *
\**************************************************************/

//Sample Applet of VasTabs

import VasTabs;
import java.applet.Applet;
import java.awt.*;

public class VasTabsApplet extends Applet {
  VasTabs tabs, tabsWidth1, tabsWidth2, tabsWidth3, tabsWidth4, tabsWidth5, tabsWidth6, tabsWidth7, tabsWidth8;
  Panel tabs0_panel0, tabs0_panel1, tabs0_panel2, tabs0_panel3, tabs0_panel4, tabs0_panel5, tabs1_panel1, tabs1_panel2, tabs2_panel1, tabs2_panel2, tabs3_panel1, tabs3_panel2, tabs4_panel1, tabs4_panel2, tabs5_panel1, tabs5_panel2, tabs6_panel1, tabs6_panel2, tabs7_panel1, tabs7_panel2, tabs8_panel1, tabs8_panel2;
  Label tabs0_label1, tabs0_label2, tabs0_label3;
  Button tabs0_button1;
  TextField tabs0_textArea1;

  public String getAppletInfo() {
    return (new String("VasTabsApplet v3.1 February 13th, 1999, (C) 1997, 1998, 1999, 2000, 2001 Vasile Calmatui"));
  }

  //constructor
  public VasTabsApplet() {
    this.setLayout(null);
    this.resize(400, 400);
    setBackground(Color.lightGray);

    //where is the left upper corner of tabs=(25, 25)
    //the dimension of tabs=(350, 350)
    tabs=new VasTabs(25, 25, 350, 350);

    //Creating the Panel
    tabs0_panel0=new Panel();
    tabs0_panel0.setLayout(null);

    tabs1_panel1=new Panel();
    tabs1_panel2=new Panel();
    tabsWidth1=new VasTabs(20, 10, 140, 65, 1);
    tabsWidth1.addTab("Width", tabs1_panel1);
    tabsWidth1.addTab("of 1", tabs1_panel2);
    tabs0_panel0.add(tabsWidth1);

    tabs2_panel1=new Panel();
    tabs2_panel2=new Panel();
    tabsWidth2=new VasTabs(180, 10, 140, 65, 2);
    tabsWidth2.addTab("Width", tabs2_panel1);
    tabsWidth2.addTab("of 2", tabs2_panel2);
    tabs0_panel0.add(tabsWidth2);

    tabs3_panel1=new Panel();
    tabs3_panel2=new Panel();
    tabsWidth3=new VasTabs(20, 85, 140, 65, 3);
    tabsWidth3.addTab("Width", tabs3_panel1);
    tabsWidth3.addTab("of 3", tabs3_panel2);
    tabs0_panel0.add(tabsWidth3);

    tabs4_panel1=new Panel();
    tabs4_panel2=new Panel();
    tabsWidth4=new VasTabs(180, 85, 140, 65, 4);
    tabsWidth4.addTab("Width", tabs4_panel1);
    tabsWidth4.addTab("of 4", tabs4_panel2);
    tabs0_panel0.add(tabsWidth4);

    tabs5_panel1=new Panel();
    tabs5_panel2=new Panel();
    tabsWidth5=new VasTabs(20, 160, 140, 65, 5);
    tabsWidth5.addTab("Width", tabs5_panel1);
    tabsWidth5.addTab("of 5", tabs5_panel2);
    tabs0_panel0.add(tabsWidth5);

    tabs6_panel1=new Panel();
    tabs6_panel2=new Panel();
    tabsWidth6=new VasTabs(180, 160, 140, 65, 6);
    tabsWidth6.addTab("Width", tabs6_panel1);
    tabsWidth6.addTab("of 6", tabs6_panel2);
    tabs0_panel0.add(tabsWidth6);

    tabs7_panel1=new Panel();
    tabs7_panel2=new Panel();
    tabsWidth7=new VasTabs(20, 235, 140, 65, 7);
    tabsWidth7.addTab("Width", tabs7_panel1);
    tabsWidth7.addTab("of 7", tabs7_panel2);
    tabs0_panel0.add(tabsWidth7);

    tabs8_panel1=new Panel();
    tabs8_panel2=new Panel();
    tabsWidth8=new VasTabs(180, 235, 140, 65, 8);
    tabsWidth8.addTab("Width", tabs8_panel1);
    tabsWidth8.addTab("of 8", tabs8_panel2);
    tabs0_panel0.add(tabsWidth8);

    //Creating the Panel
    tabs0_panel1=new Panel();
    tabs0_panel1.setLayout(null);
    tabs0_label1=new Label("You can add anything in the panels");
    tabs0_label1.reshape(10, 30, 300, 25);
    tabs0_panel1.add(tabs0_label1);
    tabs0_button1=new Button("Remove Red tab");
    tabs0_button1.reshape(10, 60, 150, 30);
    tabs0_panel1.add(tabs0_button1);
    tabs0_textArea1=new TextField("TextField");
    tabs0_textArea1.reshape(10, 100, 150, 25);
    tabs0_panel1.add(tabs0_textArea1);

    //Creating the Panel
    tabs0_panel2=new Panel();
    tabs0_panel2.setLayout(null);
    tabs0_label2=new Label("This is Tab 2");
    tabs0_label2.reshape(10, 60, 300, 25);
    tabs0_panel2.add(tabs0_label2);

    //Creating the Panel
    tabs0_panel3=new Panel();
    tabs0_panel3.setLayout(null);
    tabs0_label3=new Label("Please don't remove me");
    tabs0_label3.reshape(10, 90, 300, 25);
    tabs0_panel3.add(tabs0_label3);

    tabs0_panel4=new Panel();
    tabs0_panel5=new Panel();

    //adding the tabs
    tabs.addTab("Test", tabs0_panel0);
    tabs.addTab("One", tabs0_panel1);
    tabs.addTab("2", tabs0_panel2);
    tabs.addTab("Red", tabs0_panel3);
    tabs.setColorTab("Red", Color.red);
    tabs0_panel3.setBackground(Color.red);
    tabs.addTab("Disabled", tabs0_panel4);
    tabs.addTab("if unregistered", tabs0_panel5);
    add(tabs);
  }//end constructor

  public boolean handleEvent(Event e) {
    //if clicked on button, remove red panel
    if(e.target==tabs0_button1 && (e.arg==tabs0_button1.getLabel())) {
      tabs0_button1.disable();
      tabs.removeTab("Red");
      tabs.refreshTabs();
      return true;
    }//end if
    return false;
  }//end handleEvent
}//end class VasTabsApplet

© 1997, 1998, 1999, 2000 made with VasJava2HTML