How to embed applet in swings

hi i developed a program for timer in applet, i want to include it in to jFrame,can some one help me,i am developing program in netbeans

GANGINENI wrote:
hi i developed a program for timer in applet, i want to include it in to jFrame, can some one help me,i am developing program in netbeansYes.
1) ....
h1. Edit:
in light of camickr's note, I am deleting my post. The original poster is now on my DNH list and will remain there until his behavior changes.
Edited by: Encephalopathic on Oct 31, 2008 2:20 PM

Similar Messages

  • How to embed SWT to swings

    I have found information regarding how to embed Swings in SWT.
    But i have to embed Swt browser in swings
    Please see the links for examples:
    http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Bringupabrowser.htm
    http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/EmbedSwingandAWTinSWT.htm
    I have to show two browsers in same window which i have partially done by embeding swings in swt. but need the otherway.
    Here is that code:
    import java.awt.Color;
    import java.awt.Frame;
    import java.awt.Panel;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.JSeparator;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.awt.SWT_AWT;
    import org.eclipse.swt.browser.Browser;
    import org.eclipse.swt.browser.LocationEvent;
    import org.eclipse.swt.browser.LocationListener;
    import org.eclipse.swt.browser.ProgressEvent;
    import org.eclipse.swt.browser.ProgressListener;
    import org.eclipse.swt.browser.StatusTextEvent;
    import org.eclipse.swt.browser.StatusTextListener;
    import org.eclipse.swt.layout.GridData;
    import org.eclipse.swt.layout.GridLayout;
    import org.eclipse.swt.widgets.Composite;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.widgets.Label;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.ProgressBar;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Text;
    import org.eclipse.swt.widgets.ToolBar;
    import org.eclipse.swt.widgets.ToolItem;
    import com.jgoodies.forms.layout.CellConstraints;
    import com.jgoodies.forms.layout.FormLayout;
    public class BringUpBrowser {
    public static void main(String[] args) {
         BringUpBrowser browser= new BringUpBrowser();
         browser.showBrowser();
    public void showBrowser(){
    Display display = new Display();
    final Shell shell = new Shell(display);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 3;
    shell.setLayout(gridLayout);
    shell.setMaximized(true);
    final Browser browser1 = new Browser(shell, SWT.NONE);
    GridData data1 = new GridData();
    data1.horizontalAlignment = GridData.FILL;
    data1.verticalAlignment = GridData.FILL;
    data1.horizontalSpan = 3;
    data1.grabExcessHorizontalSpace = true;
    data1.grabExcessVerticalSpace = true;
    browser1.setLayoutData(data1);
    browser1.setUrl("www.indussoftware.com");
    ToolBar toolbar = new ToolBar(shell, SWT.NONE);
    ToolItem itemBack = new ToolItem(toolbar, SWT.PUSH);
    itemBack.setText("Back");
    ToolItem itemForward = new ToolItem(toolbar, SWT.PUSH);
    itemForward.setText("Forward");
    ToolItem itemStop = new ToolItem(toolbar, SWT.PUSH);
    itemStop.setText("Stop");
    ToolItem itemRefresh = new ToolItem(toolbar, SWT.PUSH);
    itemRefresh.setText("Refresh");
    ToolItem itemGo = new ToolItem(toolbar, SWT.PUSH);
    itemGo.setText("Go");
    GridData data = new GridData();
    data.horizontalSpan = 3;
    toolbar.setLayoutData(data);
    Label labelAddress = new Label(shell, SWT.NONE);
    labelAddress.setText("Address");
    final Text location = new Text(shell, SWT.BORDER);
    data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.horizontalSpan = 2;
    data.grabExcessHorizontalSpace = true;
    location.setLayoutData(data);
    final Browser browser = new Browser(shell, SWT.NONE);
    data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.FILL;
    data.horizontalSpan = 3;
    data.grabExcessHorizontalSpace = true;
    data.grabExcessVerticalSpace = true;
    browser.setLayoutData(data);
    final Label status = new Label(shell, SWT.NONE);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    status.setLayoutData(data);
    final ProgressBar progressBar = new ProgressBar(shell, SWT.NONE);
    data = new GridData();
    data.horizontalAlignment = GridData.END;
    progressBar.setLayoutData(data);
    Composite composite = new Composite(shell, SWT.EMBEDDED);
    data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.CENTER;
    data.horizontalSpan = 3;
    composite.setLayoutData(data);
    Frame frame = SWT_AWT.new_Frame(composite);
    JPanel panel = new JPanel();
    panel.setLayout(new FormLayout("0:grow(0.4),0:grow(0.2),0:grow(0.4)","5dlu,5dlu,16dlu"));
    frame.add(panel);
    CellConstraints cc = new CellConstraints();
    JButton button = new JButton("Close");
    panel.add(new JSeparator(),cc.xyw(1, 1, 3));
    panel.add(button,cc.xy(2, 3));
    button.addActionListener(new ActionListener(){
              public void actionPerformed(ActionEvent e) {
                   //this = null;
    //end of chakri
    /* event handling */
    Listener listener = new Listener() {
    public void handleEvent(Event event) {
    ToolItem item = (ToolItem) event.widget;
    String string = item.getText();
    if (string.equals("Back"))
    browser.back();
    else if (string.equals("Forward"))
    browser.forward();
    else if (string.equals("Stop"))
    browser.stop();
    else if (string.equals("Refresh"))
    browser.refresh();
    else if (string.equals("Go"))
    browser.setUrl(location.getText());
    browser.addProgressListener(new ProgressListener() {
    public void changed(ProgressEvent event) {
    if (event.total == 0)
    return;
    int ratio = event.current * 100 / event.total;
    progressBar.setSelection(ratio);
    public void completed(ProgressEvent event) {
    progressBar.setSelection(0);
    browser.addStatusTextListener(new StatusTextListener() {
    public void changed(StatusTextEvent event) {
    status.setText(event.text);
    browser.addLocationListener(new LocationListener() {
    public void changed(LocationEvent event) {
    if (event.top)
    location.setText(event.location);
    public void changing(LocationEvent event) {
    itemBack.addListener(SWT.Selection, listener);
    itemForward.addListener(SWT.Selection, listener);
    itemStop.addListener(SWT.Selection, listener);
    itemRefresh.addListener(SWT.Selection, listener);
    itemGo.addListener(SWT.Selection, listener);
    location.addListener(SWT.DefaultSelection, new Listener() {
    public void handleEvent(Event e) {
    browser.setUrl(location.getText());
    shell.open();
    browser.setUrl("http://google.co.in");
    while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
    display.sleep();
    display.dispose();
    Here Iam facing problems while adding Listeners.
    Can u help me in this?

    GANGINENI wrote:
    hi i developed a program for timer in applet, i want to include it in to jFrame, can some one help me,i am developing program in netbeansYes.
    1) ....
    h1. Edit:
    in light of camickr's note, I am deleting my post. The original poster is now on my DNH list and will remain there until his behavior changes.
    Edited by: Encephalopathic on Oct 31, 2008 2:20 PM

  • How to embed applet in html?

    how do you embed an applet (made using the GUI builder/drag and drop builder) of netbeans correctly?
    I tried it manually but it doesn't work (put the filename.class with the html file and embed it to the html code) but it says that applet failed.
    I also tried running the one netbeans automatically created located at \build folder of the project folder, but it also says applet failed.
    Can someone tell what seems to be the problem? or are there any suggestions or better way to embed an applet to a html file?

    Answers to "How to do something in NetBeans" (or any other IDE) are only going to be available at the IDE site. See here:
    http://www.netbeans.org/kb/50/tutorial-applets.html
    These forums are for Java language topics, not IDE support.

  • How to embed/perform a Java Swing form into webased Swing form

    How to embed/perform a Java Swing form into webased Swing form or any alternative.
    Suppose i have 2 or more swing forms which are desktop applications but i want those forms to be now webbased..so how can i do this.Will i need to change the swing coding or will have to keep the swing design same.what can be the best Solution.

    You can launch your existing desktop app via the web using [Java Web Start|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp]

  • How to embed html-file into swing

    hello,
    can anybody help me how to embed a html-file into a swing application??
    I try to write a swing-application, that connects to a Internetpage via Sockets.
    The problem is, that I can only see the sourcecode of the InternetPage in my JTextArea, but I want to see the whole Page just like in a browser.
    I hope anybody can help me to solve this problem, thanx mina

    u will need to use the JEditorPane component instead of Jtextarea.here is a url to help u get started
    http://java.sun.com/docs/books/tutorial/uiswing/components/simpletext.html#editorpane

  • How to embed javafx program in JSP?

    How to embed javafx program in JSP?

    This is hardly related to the original question, a separate thread would have been better...
    Anyway, you can look at [A Better Applet Experience, Part 1: a custom loading screen|http://weblogs.java.net/blog/joshy/archive/2008/08/a_better_applet.html] article for some hints.

  • How to embed fonts in a textbox in adobe acrobat 9

    Hi all,
    The forms has beed designed in adobe acrobat 9.It has the text in the textboxes with a fontstyle of DejaVu Sans Mono.The client or the user generates the form by clicking on the appropriate link and the textboxes are populated accordingly.The problem is they dont have the fontstyle used in the textbox installed on their system.So whenever they generate the pdf the font in the textbox doesn't print in properly.Is there anyway we could force it to use the font which we have originally set up.Thanks in advance

    Bernd Alheit wrote:
    Read this:
    http://www.ehow.com/how_6566713_embed-fonts-pdf.html
    I have the somthing like the following in Ctrl-D Fonts. They can not be embedded using the method above. I guess it is because the fonts in the original pdf are not available in the system. But how to embed the substitutes in the pdf file.
    Helvetica
        Type: Type 1
        Encoding: Custom
        Actual Font: Helvetica
        Actual Font Type: TrueType

  • Difference Between Applet and Swing

    Difference Between Applet and Swing

    The advantages and disadvantages of both applets and Swing are the small fluffy elephants you get inside of every box. They're quite well trained and can skeletonize your neighbors' annoying pets upon command.

  • Convert applet to swing

    Hi;
    Could anyone help me to convert my example code from applet to swing,please, thank
    import java.awt.*;
    import java.applet.*;
    import java.lang.Math;
    import java.awt.Font;
    import java.lang.Integer;
    /*** Main class == Applet  ***/
    public class Suffix extends Applet implements Runnable {
       private Thread main;
       public s_tree _tree=null;
       public node nd=null;
       public boolean userPause=false,resumed=false;
       private String str[]={"GOOGOL$","Paused","Resumed","Compacting","Done"};
       public Color bl=Color.blue,rd=Color.red;
       public Font fnt;
       public int mode=3,delay=3000;
       private char alph[]={'$','Q','W','E','R','T','Y','U','I','O',
                        'P','A','S','D','F','G','H','J','K','L',
                        'Z','X','C','V','B','N','M'};
    /*** initialisation function. It is the first Funct to be called ***/
       public void init() {
    // Temp data
          int temp=0,nxx=30;
    // Ini. of fnt , the font size + style used by this applet.
          fnt=new Font("Denis",1,25);
    /*** parsing command parameters ***/
    //      try {
    //DELAY VALUE PARAM
             String param=getParameter("DELAY");
             if (param!=null) {
                temp=Integer.parseInt(param);
                if ((temp>500)&&(temp<6000)) delay=temp;
    //x LEFTMOST coordinate
             param=getParameter("X");
             if (param!=null) {
                temp=Integer.parseInt(param);
                nxx=temp;
    //Base String parameter
             param=getParameter("STRING");
             if ((param!=null)&&(param.length()<15)) {
                str[0]=param;
    //      } catch (ParseException e) { showParseError(e); }
    // Allocating mem for _tree + initialize it .
          _tree=new s_tree(str[0],fnt);
    // Override xx (left_bound) by the caller's or the default value
          _tree.xx=nxx;
    /*** "animation loop is controled here" ***/
       public void run() {
         while(true) {
             try {
    //delay the process for time==delay
                Thread.sleep(delay);
             } catch (InterruptedException e) {}
    //controls animation loop
          repaint();
    /*** override APPLET's paint function ***/
       public void paint (Graphics g) {
    //Output graphics
          update(g);
    /*** Updates the graphics ***/
       public void update (Graphics g) {
    // Set font
          if (g.getFont()!=fnt) g.setFont(fnt);
          if ((userPause==false)&&(resumed==false)) // Is the applet paused ?
             g.clearRect(0,0,1024,768); //clears the screen
             if (_tree==null) {     // if tree is not initialised
                init();
                //_tree.show(g);
             } else {
                if (mode==3) {      // if graphics output mode is 3
                   if (nd!=null) nd._to_rd(false);
                   nd=_tree.step_compact(nd);  //compacts the tree one step further
                   if (nd==null)  // if tree is totally compacted ...
                      mode=4;   //change the ani. mode to 4 (don't call compact)
                   else
                      nd._to_rd(true);  //colors the next node to compact in red
    // Draw the "titleviewport's" comment
             g.setColor(bl);
             g.drawString(str[mode],10,15);
             _tree.show(g);     //show tree
          } else {
             g.clearRect(0,0,200,25);  //clears the "titleviewport to update it"
             g.setColor(rd);
             if (resumed==true){
                resumed=false;
                g.drawString(str[2],10,15);
             else g.drawString(str[1],10,15);
    /*** restart the animation process ***/
       public void start() {
          main=new Thread(this);
          main.start();
    /*** stops the animation ***/
       public void stop() {
          main.stop();
          main=null;
    /*** Handles the user's events (mouse , kbd , ... ***/
       public boolean handleEvent(Event evt) {
          if (evt.id==Event.MOUSE_DOWN) { //if mouse button have been pushed ...
                if (main!=null && main.isAlive()) {
                   if (userPause) {
                      main.start();
                      resumed=true;
                   } else {
                      main.stop();
                   userPause= !userPause;
                } else {
                   main= new Thread(this);
                   main.start();
                   userPause=false;
                   resumed=true;
                repaint();
             return true;
          } else {
             return super.handleEvent(evt);
    /*** Linked List of node(s) ***/
    class nodelist{
       nodelist next=null;
       node ptr=null;
       public void nodelist(){};
    /*** node of a structure tree ***/
    class node {
    // Relatives
       public nodelist children=null;
       public node parent=null;
    // variables
       public int maxchild=12,childnum=0,level=0;
       public int center[]={0,0};
       public int xlen=20,ylen=10,vspace=15,hspace=8;
       public int x[]={0,0};
       public boolean _ishidden=false;
       private Color bk=Color.black,wh=Color.white,rd=Color.red;
    // Node==red toggle variable
       public boolean to_rd=false;
    // node's text
       public String label=null;
    /*** initialisation of the node ***/
       public node(int nx,int ny,int nxl,int nyl,node nparent,int nlevel,String nstr){
          x[0]=nx; x[1]=ny;
          xlen=nxl; ylen=nyl;
          parent=nparent;
          level=nlevel;
          label=new String(nstr);
          children=new nodelist();
    /*** destroys the node ***/
       public void destruct() {
    // NOTE : not like C++ destructors . Do not confuse .
          delete_subtree();
          children=null;
          parent=null;
          bk=wh=rd=null;
          label=null;
    /*** Node to red toggle switch ***/
       public void _to_rd(boolean b) {to_rd=b;};
    /*** Adds a child to this node ***/
       public void add_child(int nx,int ny,int nxl,int nyl,node nparent,int nlevel,
                                String nstr) {
          if (childnum<maxchild) {    // if 'legal' space left ...
             if (children==null) {    // if no nodelist attached ...
                children=new nodelist(); //init. children
                children.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr); //create node
                childnum++;
             } else {
                nodelist dummy=children;
    // search for the last nodelist
                while (dummy.next!=null) dummy=dummy.next;
                dummy.next=new nodelist(); //adds a nodelist
                dummy=dummy.next;
                dummy.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr); //create child
                childnum++;
    // Tree needs to be realigned
    /*** adds a child and returns its address ***/
       public node add_child_ret(int nx,int ny,int nxl,int nyl,node nparent,int nlevel,
                                String nstr) {
          if (childnum<maxchild) {
             if (children==null) {
                children=new nodelist();
                children.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr);
                childnum++;
                return(children.ptr);
             } else {
                nodelist dummy=children;
    // search for the last child
                while (dummy.next!=null) dummy=dummy.next;
                dummy.next=new nodelist();
                dummy=dummy.next;
                dummy.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr);
                childnum++;
                return(dummy.ptr);
        return(null);
    // Tree needs to be realigned
    /*** adds the node nchild as a new children ***/
       public void add_child(node nchild) {
          nodelist dummy=null;
          dummy=children;
          if (childnum<maxchild) {
             if (children==null) {
                children=new nodelist();
                children.ptr=nchild;
                childnum++;
             } else {
                while (dummy.next!=null) dummy=dummy.next;
                dummy.next=new nodelist();
                dummy=dummy.next;
                dummy.ptr=nchild;
                childnum++;
    //Tree needs to restructured.
    /*** deletes all childrens ***/
       public void delete_subtree() {
          while (childnum>0 && children!=null) { //while child exists , kill it
             if (children.ptr!=null) {
                children.ptr.destruct();
                children.ptr=null;
                children=children.next;
             } else children=null;
             childnum--;
    /*** moves this node and its children horizontally ***/
       public void move_tree(int nx) {
          nodelist dummy=children;
          x[0]+=nx;
          while (childnum>0 && dummy!=null) {
             if (dummy.ptr!=null) {
                dummy.ptr.move_tree(nx);
                dummy=dummy.next;
    /*** removes the node from the tree (do not preserve order of ordered tree ) ***/
       public void remove_node() {
          nodelist dummy=children;
          while(dummy!=null) {
             if (dummy.ptr!=null){
                parent.add_child(dummy.ptr);
             dummy=dummy.next;
          children=null;
    //could call restructure tree here .
    //don't forget to change the node's levels !!!
    /*** show all nodes ***/
       public void show_all(Graphics g) {
          if (_ishidden==false) { //if not hidden
             if (children!=null) {  //if child exist
                nodelist dummy=children; //temp var.
                while(dummy!=null) { //while there is a child...
                   if (dummy.ptr!=null)
                      dummy.ptr.show_all(g);
                   dummy=dummy.next;
             show_node(g);
    /*** show nodes in preorder ***/
       public int preorder_show(Graphics g,int label){
          if (_ishidden==false) {
             show_node(g/*,label++*/);
             if (children!=null) {
                nodelist dummy=children;
                while(dummy!=null) {
                   if (dummy.ptr!=null) label=dummy.ptr.preorder_show(g,label);
                   dummy=dummy.next;
          return(label);
    /** show nodes in postorder ***/
       public int postorder_show(Graphics g,int label){
          if (_ishidden==false) {
             if (children!=null) {
                nodelist dummy=children;
                while(dummy!=null) {
                   if (dummy.ptr!=null) label=dummy.ptr.postorder_show(g,label);
                   dummy=dummy.next;
             show_node(g/*,label++*/);
          return(label);
    /*** show nodes in inorder ***/
       public int inorder_show(Graphics g,int label){
          if (_ishidden==false) {
             if (children!=null) {
                nodelist dummy=children;
                if (dummy.ptr!=null) label=dummy.ptr.inorder_show(g,label);
                dummy=dummy.next;
                show_node(g/*,label++*/);
                while(dummy!=null) {
                   if (dummy.ptr!=null) label=dummy.ptr.inorder_show(g,label);
                   dummy=dummy.next;
             } else show_node(g/*,label++*/);
          return(label);
    /*** Restructure the coordinates of all nodes ***/
       public int align(int min,Font fnt,int lev,Graphics g){
          int i=min; //left bound
          FontMetrics fntm=g.getFontMetrics(fnt); //used to know the text size
          level=lev;
    // node x and y radius are computed here
          xlen=4+(int)(fntm.stringWidth(label)/2);
          ylen=4+(int)(fntm.getHeight()/2);
          if (children!=null) {      //if child present ...
             nodelist dummy=children;
             while(dummy!=null) {
                if (dummy.ptr!=null) i=dummy.ptr.align(i,fnt,lev+1,g); //align them
                   dummy=dummy.next;
          x[0]=min+(int)((i-min)/2); //could be underflow so will be checked
          x[1]=lev*(vspace+(ylen*2))+26;
    // overflow should happen only when the parent node is larger than its children
          if ((x[0]-xlen)<min) { //check uf underflow occurs.
             move_tree(min+xlen-x[0]+1);
             i=x[0]+xlen+5;
          if (childnum==0) x[0]+=2;
        return(i);
    /*** returns the child following nd ***/
    /*** if nd==null -> return 1st child ***/
    /***  if nd==last children -> return null***/
       public node next_child(node nd) {
          nodelist dummy=null;
          if (children==null) return(null);
          if (nd==null) return(children.ptr);
          dummy=children;
          while (dummy.ptr!=nd) {
             if (dummy.next!=null)
                dummy=dummy.next;
             else
                return(null);
          dummy=dummy.next;
          if (dummy!=null) return(dummy.ptr);
             else return(null);
    /*** returns child with first letter==nh ***/
       public node get_childd(char ch) {
          nodelist dummy=null;
          dummy=children;
          while (dummy!=null) {
             if (dummy.ptr!=null) {
                if (dummy.ptr.label.charAt(0)==ch)
                   return(dummy.ptr);
             dummy=dummy.next;
        return(null);
    /*** returns the nodelist containing nd ***/
       public nodelist get_child(node nd) {
          nodelist dummy=children;
          while (dummy!=null) {
             if (dummy.ptr==nd) return(dummy);
             dummy=dummy.next;
        return(null);
    /*** outputs the node to Screen ***/
       public void show_node(Graphics g) {
          if (_ishidden==false) {
             if (level>0) {  //if it is not a root then draw link-line
                g.setColor(bk);
                g.drawLine(x[0],x[1]-ylen,parent.x[0],parent.x[1]+parent.ylen); //from this node to parent node
             if (to_rd==false)
                g.setColor(wh);
             else
                g.setColor(rd);
             g.fillOval(x[0]-xlen,x[1]-ylen,xlen*2,ylen*2); //draws an oval
             g.setColor(bk);
             g.drawString(label,x[0]-xlen+4,x[1]+ylen-12);  //output the text
    /*** class which uses nodes to create a SUFFIX TREE ***/
    class s_tree {
       node root=null;    // root node.
       String str=null;   // 'search' string
       Font fnt=null;     // font type
       int xx=30;         // left limit for graphics
    /*** initialize a SUFFIX TREE with string==nstr and Font==nfnt ***/
       public s_tree(String nstr,Font nfnt) {
          str=new String(nstr);
          fnt=nfnt;
          create();
    /*** uninitialize the structure **/
       public void destruct() {
          root.destruct();
          str=null;
          fnt=null;
    /*** show the tree ***/
       public void show(Graphics g) {
          root.align(xx,fnt,0,g);   // restructure node's coordinates
          root.show_all(g); //show tree
    /*** creates a tree structure from String=str ***/
       public void create() {
          node dummy=null;
          root=new node(0,0,0,0,dummy,0," "); //create root
          root.parent=null; //just to make sure ...
          for (int i=0;i<str.length();i++) {
    // Create subtree of root in the following way :
    //    create subtree ("ASDF$");
    //        "     "    ("aSDF$");
    //       "    "      ("asDF$"); ...
    // where : the UPPERCASE letters is the part of the string sent to insert_string
             insert_string(str.substring(i));
          //root.align(0,fnt,0); //align root now ?
    /*** creates a subtree of ROOT with String=nstr ***/
       public void insert_string(String nstr) {
          node dummy2=null,dummy=null;
          int i=0;
          dummy=root;
          dummy2=root;
    // As long as a children of dummy2 have the letter nstr[i] , dummy==thischildren
    // It is used to make sure that a node does not have two children with the
    // same letter
          while (dummy2!=null) {
             dummy2=dummy2.get_childd(nstr.charAt(i));
             if (dummy2!=null) {
                i++;
                dummy=dummy2;
    //create the nodes for the rest of the string
          for(;i<nstr.length();i++) {
             if (dummy!=null) dummy=dummy.add_child_ret(0,0,0,0,dummy,1,nstr.substring(i,i+1));
    // Compacts the tree node by node and returns the next node to compact
    // if node==null , compacts the first node ...
    //Works in POST-ORDER
       public node step_compact(node nd) {
          node dummy=nd,dummy2=null;
          nodelist ndlst=null;
    // GOES TO THE LOWER LEFT CHILDREN
          if (nd==null) { //first call !
             dummy=root;
             while(dummy.children!=null) {
                if (dummy.children.ptr==null)
                   dummy.children=dummy.children.next;
                else
                   dummy=dummy.children.ptr;
    //*** tries to find a 'compactable' node ***
    //*** It uses the POST-ORDER method      ***
    // if this node is not the last children then try to find next compactable node
    // in the next children.
          if (dummy.parent.childnum!=1) dummy=next_chain(dummy);
          if (dummy==null) return(null); //fully optimized
    //remove parent node.
    /*** THIS IS WHERE COMPACTING TAKES PLACE  **/
          dummy2=dummy.parent.parent;
          ndlst=dummy2.get_child(dummy.parent);
          if (ndlst==null) return(null); //we've got a beeeeg problem if this happens ...
    //*** merges the parent string with this one and delete parent .
          dummy.label=dummy.parent.label.concat(dummy.label);
          ndlst.ptr=dummy;
          //delete parent .
          dummy.parent=null;
          dummy.parent=dummy2;
    //      root.align(0,fnt,0);
        return(dummy);
    /*** finds the next chain in the tree (i.e. the next compactable node) ***/
       public node next_chain(node nd){
          node dummy=null;
          if (nd.parent==null) return(null); //finished ! This is the root
          if (nd.parent.childnum==1) return(nd); //can be optimized
    // finds the nd.parent's child following nd
          dummy=nd.parent.next_child(nd);
          if (dummy==null)  // if OLD_nd==last child
             return(next_chain(nd.parent));      //tries to find a chain upwards
          else {
                 // OLD_nd was not the last child . nd==OLD_nd's next brother
    // GOES TO THE LOWER LEFT most child of nd's subtree.
             while(dummy.children!=null) {
                if (dummy.children.ptr==null)
                   dummy.children=dummy.children.next;
                else
                   dummy=dummy.children.ptr;
             return(next_chain(dummy)); // returns the next compactable node
    };

    First, show me the rupees! Show me the rupees!

  • How to embed audio to my website using quicktime when I get "file not found

    hi,
    i've been trying to embed audio into my website all night and I get a file not found message even though I;ve checked 100 times and all files are where links say they should be..
    but even just linking to audio (mp4) files won't work...
    everything is o.k. with non-audio links on my website - only the mp4 audio can't be found.
    can anyone help me? or post the correct code?
    I've tried using these formats..
    <EMBED SRC="anymovie.mov" HEIGHT=176 WIDTH=136>
    <embed
    src="http://www.crossandthrone.com/.samples/qt/sample-reference2.mov"
    width="242" height="199" autoplay="false" loop="false"
    controller="true" bgcolor="#666666"
    pluginspage="http://www.apple.com/quicktime/"></embed>
    the pages that should play audio just have a quicktime file with a question mark on them
    help would be much appreciated!

    Start here:
    http://www.mediacollege.com/video/streaming/
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "subdued2u" <[email protected]> wrote in
    message
    news:gbg2th$r13$[email protected]..
    > Hello ,guys, i have a website,, and i would like to add
    upload vidoes on
    my
    > website i have tried but did not work can anyone please
    tell me how to
    embed my
    > videos in my website using dreamwever ?
    > thank so much
    >

  • How to embed the needed fonts in a pdf file

    Dear Sir/Mam,
    We had purchased licenced version of adobe acrobat x pro
    We are facing issues while embedding the font in the pdf file
    Please find the below mentioned requirement
    Requirement:
    We have a pdf file (template) with some static images and static text in it
    We need to populate dynamic data in the pdf file for this we may use text boxes
    We need to set the font name for the text box and embed that font in the pdf template (Eg:Font to be used in textboxes is "RotisSansSerif-Bold")
    Queries
    Please let us know how to embed the needed fonts in the pdf file?
    Once user exports the pdf file, even if user doesnot have the fonts installed in his system the text need to be displayed in the same fonts,how to acheive this?Eg:if we define "RotisSansSerif-Bold" as font in the textboxes,after exporting the data the text need to be in the same font.
    Note:
    Fonts will only installed in the application server and not in the client system
    The mentioned requirement need to work on below mentioned specifications
    OS:Windiows-XP,  Browser:IE
    OS:Mac osx, Browser:Safari
    Regards,
    S.N.Prasad

    There is a similar post just a few away from yours. I will suggest what I would try. Open your job settings file (press or print preferred to get all fonts) and then select the properties and the font tab. At your font to the always embed list and you will likely need to uncheck the subset box. Then save your job settings (give it a name that is meaningful to you, you can not use the settings file you started with as they are read only and I do not recommend changing that). Maybe that will do the job. Of course that is for the creation of the PDF, I forgot you were talking about a form. You might check the form field properties, but I suspect you have already tried that. Guess I don't play with forms enough. Others may be by to answer.

  • How to embed email opt-in form in image

    How to embed email opt-in form in image

    You cannot delete the email field. It is required for the form to work. One thing you can do that is a bit more work is to use Adobe Forms. I believe it is at Quickly & Easily Create Online Forms and Surveys | Adobe FormsCentral and create the form you want there and then you can copy the embed code from it and use the insert HTML to embed the form in your page.

  • Ical calendar how to embed into webpage

    Using iWeb I successfully published my iCal calendar to my website. However suddenly my embedded calendar stopped showing any entries. I understand this is due to the changes in the mobileme calendar. Can I restore the previous very useful facility? Or do I have to switch to Google calendar? It a resource that I found very useful for clients wanting to see when I was available and I am sure many other users use a facility like this.  must say that Apple have annoyed me over this. It was not easy finding how to embed the calendar in the first place and now they seem to have downgraded the mobileme calendar. I thought the general trend was to improve applications not the reverse.
    Any help would be much appreciated

    I don't believe you can restore that capability. 
    You can add a Google calendar to a web page (it's scaleable whereas the iCal calendar was not) and then sync your iCal calendar to the Google calendar with Google Sync Services.  An example is shown on this demo page: Google Calendar.
    OT

  • How to embed image in email, not as an attachment?

    I need to know how to embed an image into Mail without making it an attachment. Any ideas?
    Thanks in advance.
    Hana

    drag the image to the email. that's all. how it will show on the other end depends on the email client configuration of your email recipients, not on you.

  • How to embed JavaScript in a DynPro View?

    Hello,
    I hava a standard DynPro application.
    I would like to add a link UI which by pressing it will activate a JavaScript function. Can someone please show me how to do it and ingeneral how to embed JavaScpript in a DynPro View?

    This (protocol javascript:) probably works in current releases but in future releases it will be disabled by default for security reasons.
    The set of allowed URL protocols will then be configurable in the J2EE server.
    Armin
    Message was edited by: Armin Reichert

Maybe you are looking for