How to kill the applet

how to kill the applet which in the browser.
With Regards
Santhosh

my code.. this is main program for my applet. can find out errors. if not i will send the code to u.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.io.*;
public class StyleEditor extends Applet implements ItemListener ,ColorListener
    public ImageButton imgBold,imgItalic;
    public ColorButton colorButton;
    public Choice fontFace,fontSize;
    public TextArea textArea;
    public Panel toolBar,textPanel;
    public String content;
    public Font font = new Font("Arial",Font.ITALIC,16);
    public ColorDialog dialog;
    public Frame f;
    public String sColor;
    public InputStream in;
    private int size[] = {8,10,12,14,18,24,36};
    private Label textLabel;
    public void init()
        try
            setLayout(new BorderLayout());
            toolBar = new Panel();
            toolBar.setBackground(Color.lightGray);
            Toolkit toolkit = getToolkit();
            in = StyleEditor.class.getResourceAsStream("bold.gif");
            byte bin[] = new byte[in.available()];
            in.read(bin);
            Image ibold = toolkit.createImage(bin);
            in = StyleEditor.class.getResourceAsStream("italic.gif");
            byte binc[] = new byte[in.available()];
            in.read(binc);
            Image iitalic = toolkit.createImage(binc);
            imgBold = new ImageButton(ibold);
            imgItalic = new ImageButton(iitalic);
            fontFace = new Choice();
            fontSize = new Choice();
            colorButton = new ColorButton();
            f = new Frame();
            dialog = new ColorDialog(f,"Color Chooser",true,StyleEditor.this);
            textLabel = new Label("             Edit Style   ",Label.CENTER);
            textLabel.setFont(new Font("Arial",Font.BOLD,18));
            String editColor= getParameter("editcolor");
            if(editColor!=null)
                int eValue = Integer.parseInt(editColor,16);
                textLabel.setForeground(new Color(eValue));
            String fontArray[] = toolkit.getFontList();
            content = getParameter("style");
            String fname = getParameter("fname");
            String fsize = getParameter("fsize");
            Boolean bBold = new Boolean(getParameter("bold"));
            Boolean bItalic = new Boolean(getParameter("italic"));
            sColor= getParameter("oldcolor").substring(1);
            int value = Integer.parseInt(sColor,16);
            colorButton.setColor(new Color(value));
            boolean bold = bBold.booleanValue();
            boolean italic = bItalic.booleanValue();
            imgBold.setSelected(bold);
            imgItalic.setSelected(italic);
            for(int i=0;i<fontArray.length;i++)
                fontFace.addItem(fontArray);
fontFace.addItemListener(this);
for(int i=0;i<size.length;i++)
fontSize.addItem(size[i]+"");
fontSize.addItemListener(this);
toolBar.setLayout(new FlowLayout(FlowLayout.LEFT));
toolBar.add(imgBold);
toolBar.add(imgItalic);
toolBar.add(fontFace);
toolBar.add(fontSize);
toolBar.add(colorButton);
toolBar.add(textLabel);
textPanel = new Panel();
textPanel.setLayout(new BorderLayout());
textArea = new TextArea(content);
textArea.setEditable(false);
textArea.setBackground(Color.white);
textArea.setForeground(new Color(value));
if(fname!=null && fsize!=null)
setStyleFont(fname,fsize,bold,italic);
textPanel.add(textArea);
add(toolBar,BorderLayout.NORTH);
add(textPanel,BorderLayout.CENTER);
imgBold.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
boldActionPerformed(ae);
imgItalic.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
italicActionPerformed(ae);
colorButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
if(!dialog.isVisible())
dialog = null;
dialog = new ColorDialog(f,"Color Chooser",true,StyleEditor.this);
dialog.setLocation(colorButton.getLocation());
dialog.setLocation(200,200);
dialog.pack();
dialog.setVisible(true);
}catch(Exception e)
System.out.println(e);
public void setStyleFont(String fname,String fsize,boolean bold,boolean italic)
int s = sizeValue(Integer.parseInt(fsize));
fontFace.select(fname);
fontSize.select(s+"");
if(bold && italic)
font = new Font(fname,Font.BOLD+Font.ITALIC,s);
textArea.setFont(font);
return;
}else
if(bold)
font = new Font(fname,Font.BOLD,s);
textArea.setFont(font);
return;
}else
if(italic)
font = new Font(fname,Font.ITALIC,s);
textArea.setFont(font);
return;
}else
font = new Font(fname,Font.PLAIN,s);
textArea.setFont(font);
return;
public void itemStateChanged(ItemEvent e)
String f = fontFace.getSelectedItem();
String s = fontSize.getSelectedItem();
font = new Font(f,font.getStyle(),Integer.parseInt(s));
textArea.setFont(font);
public void boldActionPerformed(ActionEvent ae)
if(imgBold.isSelected())
if(imgItalic.isSelected())
font = new Font(font.getName(),Font.BOLD+Font.ITALIC,font.getSize());
textArea.setFont(font);
return;
font = new Font(font.getName(),Font.BOLD,font.getSize());
textArea.setFont(font);
return;
}else
if(imgItalic.isSelected())
font = new Font(font.getName(),Font.ITALIC,font.getSize());
textArea.setFont(font);
return;
font = new Font(font.getName(),Font.PLAIN,font.getSize());
textArea.setFont(font);
return;
public void italicActionPerformed(ActionEvent ae)
if(imgItalic.isSelected())
if(imgBold.isSelected())
font = new Font(font.getName(),Font.BOLD+Font.ITALIC,font.getSize());
textArea.setFont(font);
return;
font = new Font(font.getName(),Font.ITALIC,font.getSize());
textArea.setFont(font);
return;
}else
if(imgBold.isSelected())
font = new Font(font.getName(),Font.BOLD,font.getSize());
textArea.setFont(font);
return;
font = new Font(font.getName(),Font.PLAIN,font.getSize());
textArea.setFont(font);
return;
public boolean isBold()
return imgBold.isSelected();
public boolean isItalic()
return imgItalic.isSelected();
public void colorSelection(Color currentColor)
colorButton.setColor(currentColor);
textArea.setForeground(currentColor);
int r = currentColor.getRed();
String red = Integer.toHexString(r);
if(red.length()==1)
red = 0+red;
int g = currentColor.getGreen();
String green =Integer.toHexString(g);
if(green.length()==1)
green = 0+green;
int b = currentColor.getBlue();
String blue =Integer.toHexString(b);
if(blue.length()==1)
blue = 0+blue;
sColor = red+green+blue;
public String getName()
return font.getName();
public int getFSize()
switch(font.getSize())
case 8 : return 1;
case 10 : return 2;
case 12 : return 3;
case 14 : return 4;
case 18 : return 5;
case 24 : return 6;
case 36 : return 7;
default : return 0;
public int sizeValue(int value)
switch(value)
case 1 : return 8;
case 2 : return 10;
case 3 : return 12;
case 4 : return 14;
case 5 : return 18;
case 6 : return 24;
case 7 : return 36;
default : return 0;
public void stop()
System.out.println("Stop");
destroy();
public void destroy()
imgBold=null;
imgItalic=null;
colorButton = null;
fontFace =null;
fontSize=null;
textArea=null;
toolBar=null;
textPanel=null;
content=null;
font = null;
dialog=null;
f=null;
sColor=null;
in=null;
textLabel=null;
super.destroy();

Similar Messages

  • HOw to run the Applet in dos mode

    how to run the applet in Command Prompt(DOS).
    I have save this in directory D/vijay/javap/A.java and my JDK is in C drive.
    Plz send me reply as soon as possible.
    My code is :-
    import java.applet.*;
    import java.awt.*;
    public class A extends Applet
    private int w, h;
    public void init( )
         w = 45;
         h = 50;
    public void paint(Graphics g)
         g.drawRect(w, h, 20, 80);
    }

    import java.applet.*;
    import java.awt.*;
    public class A extends Applet
    private int w, h;
    public void init( )
    w = 45;
    h = 50;
    public void paint(Graphics g)
    g.drawRect(w, h, 20, 80);
    <applet class="A" height="200" width="200" code="A.class">
    </applet>
    */And in command prompt
    javac A.java
    appletviewer A.java
    Message was edited by:
    passion_for_java

  • How to kill the process chain

    hi,
        I have question how to kill the process chain during running.
    thank you.

    Hi
    If the process chain is running in background,
    goto <b>SM37</b>
    Give * in the jobname
    Give the username who scheduled the process chain
    Job status - check the check boxes - SCHED, relased, ready, active
    click <b>execute</b>.
    It displays all the process chains that, scheduled & running.
    You can select the process chain that need to be stopped & click STOP active job or ctrl+F1.
    Hope this helps!
    Kindly award points for all useful answers.
    If you post the BW related queries in the <b>BI general</b> forum, you will get more answers.
    Best regards,
    Thangesh

  • How to kill the hanged JFrame in swing?

    How to kill the hanged frame in swing?
    I am opening multiple JFrame and working on them.These frames are plcaed in JDesktopPane.
    If one frame is hanged up then i could not work on others .
    I need to kill the hanged frame.
    Assist me.

    am opening multiple JFrame and working on them.These frames are plcaed in JDesktopPaneWell, a JFrame, can't be added to a JDesktopPane, so your question doesn't even make sense.
    As was suggested earlier, if your GUI is unresponsive, then that means you are blocking the GUI EDT and the GUI can't respond to events. Don't do this.
    Read the Swing tutorial on Concurrency to understand why this happens and to learn the proper way to write GUI code so it won't happen.

  • How to get the applet method value in javascript variable

    Hi,
    I have an applet which reading the text file content, text file has valued either ON or OFF
    import java.applet.*;
    import java.io.*;
    public class A extends Applet
    public String line="";
    public void init( )
    String strPath ="D:/WAS_Status.txt";
    try
                             BufferedReader objReader = new BufferedReader(new FileReader(strPath));
                             line = objReader.readLine();
    }catch( IOException e)
    e.printStackTrace();
                        System.out.println("val :"+line);
              public boolean returnFileValue()
                   if("ON".equals(line))
                        return true;
                   else
                        return false;
    In html file :
    <HTML>
    <HEAD>
    <SCRIPT language="JavaScript">
    var line='';
    function loadAppContent()
         line=document.TestApplet.returnFileValue();
         alert("val : "+line);
    </SCRIPT>
    </HEAD>
    <BODY onload="loadAppContent()">
    <APPLET CODE="A.class" NAME="TestApplet" >
    </APPLET >
    </BODY>
    </HTML>
    I am calling the applet method. But I am not able to get value either as true or false.
    line=document.TestApplet.returnFileValue();
    Getting error as object doesnt support this property.
    I tried, line=document.TestApplet.line;
    Gets val as undefined.
    The line variable of Applet will return either ON or OFF value.
    Pls suggest where it has gone wrong or is there any other way?

    Yes it is a reserved word to warn that this applet , lets say send messages to the HTML page that call it.
    You will find the instruction how to do that at sun site.
    Yes you have to implement an interface inside the applet (code)
    and send a message to HTML with the name and parameters of
    the Javascript you want to call!
    But for all this to work you have to put in your project two new classes.
    And after that call some methods that does the job you want.
    Look for Java to JavaScript Comunication to get what you want!.
    check this per exemple!
    http://java.sun.com/products/plugin/1.2/docs/jsobject.html
    See You ( Ate mais )

  • How to kill the yellow outline when using setFocus?

    Hi...
    I tried using:
    btnname._focusrect = false;
    It did kill the yellow outline but then I can't navigate using the up/down/right/left key anymore. How to solve this problem? I have been researching days on this.
    Please help!
    Thks!

    Hi Kartik,
    I tried:
    _root._focusrect = false;
    It did remove the outline but I could not navigate using the arrow keys anymore, I can only "tab" through the buttons. I need to use the arrow keys as this is for a presentation using a remote control.
    As for:
    _global._focusrect = false;
    It didn't work.
    I still don't understand why removing the yellow outline also means removing the arrows functions?...mmmm
    Thks...

  • How to copy the applet output ?

    my java file is successfully compiled and i get a big applet output,now my problem met is how to copy those data form the applet window then paste them into txt file or others?
    or maybe some other methods exist now to convert the applet output ? but it looks like fixed. :(

    If you want it in a file why don't you write it to a file instead of a GUI, much lesss an applet, in the first place.
    See the java.io.* package.

  • How to kill the blocking session

    hi expert,
    when i m going to run the below query
    Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH'  where rti.interface_transaction_id = 3671265
    it gives the error:
    ORA-00054 resource busy and acquire with NOWAIT specified.
    i find out the blocking session by using the blow query;
    SELECT  a.SESSION_ID, a.SESSION_SERIAL#, min(A.SAMPLE_TIME) start_time,max(A.SAMPLE_TIME) end_time,a.inst_id, a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME,max(A.SAMPLE_TIME) - min(A.SAMPLE_TIME) 
    FROM GV$ACTIVE_SESSION_HISTORY a  ,gv$sql s, dba_objects o
    where a.sql_id=s.sql_id
    and A.CURRENT_OBJ# = O.OBJECT_ID
    and blocking_session is not null
    and a.user_id  != 0 -- exclude SYS user
    and a.sample_time > sysdate - 7
    and a.event = 'enq: TX - row lock contention'
    group by a.SESSION_ID, a.SESSION_SERIAL#, a.inst_id,a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME
    it gives the output
    SESSION_ID
    SESSION_SERIAL#
    START_TIME
    END_TIME
    INST_ID
    BLOCKING_SESSION
    USER_ID
    SQL_TEXT
    EVENT
    OBJECT_NAME
    MAX(A.SAMPLE_TIME)-MIN(A.SAMPLE_TIME)
    369
    45,849
    9/4/2013 8:29:33.119 AM
    9/4/2013 11:40:27.508 AM
    1
    554
    173
    SELECT POL.UNIT_PRICE   FROM PO_LINES POL  WHERE POL.PO_LINE_ID = :b1
    enq: TX - row lock contention
    PO_LINES_ALL
    +00 03:10:54.389000
    554
    18,872
    9/4/2013 8:29:33.119 AM
    9/4/2013 11:40:27.508 AM
    1
    365
    173
    SELECT POL.UNIT_PRICE,POL.QUANTITY,POL.UNIT_MEAS_LOOKUP_CODE,POL.AMOUNT   FROM PO_LINES POL  WHERE POL.PO_LINE_ID = :b1
    enq: TX - row lock contention
    JA_IN_PO_LINE_LOCATION_TAXES
    +00 03:10:54.389000
    572
    168
    9/4/2013 8:29:33.119 AM
    9/4/2013 11:40:27.508 AM
    1
    554
    173
    select line_location_id into :b0 from po_line_locations_all where line_location_id=:b1 for update of line_location_id
    enq: TX - row lock contention
    PO_LINE_LOCATIONS_ALL
    +00 03:10:54.389000
    581
    4,973
    9/4/2013 10:49:38.157 AM
    9/4/2013 10:50:39.259 AM
    1
    572
    173
    Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH'  where rti.interface_transaction_id = 3671265
    enq: TX - row lock contention
    RCV_TRANSACTIONS_INTERFACE
    +00 00:01:01.102000
    my problem is in the above  output among 4 which i have to delete so sove my issue.
    its very urgent for me.
    plz plz suggest me and how can i kill the session.
    thanks & regards
    pritesh ranjan

    priteshranjan wrote:
    hi expert,
    when i m going to run the below query
    Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH'  where rti.interface_transaction_id = 3671265
    it gives the error:
    ORA-00054 resource busy and acquire with NOWAIT specified.
    i find out the blocking session by using the blow query;
    SELECT  a.SESSION_ID, a.SESSION_SERIAL#, min(A.SAMPLE_TIME) start_time,max(A.SAMPLE_TIME) end_time,a.inst_id, a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME,max(A.SAMPLE_TIME) - min(A.SAMPLE_TIME)
    FROM GV$ACTIVE_SESSION_HISTORY a  ,gv$sql s, dba_objects o
    where a.sql_id=s.sql_id
    and A.CURRENT_OBJ# = O.OBJECT_ID
    and blocking_session is not null
    and a.user_id  != 0 -- exclude SYS user
    and a.sample_time > sysdate - 7
    and a.event = 'enq: TX - row lock contention'
    group by a.SESSION_ID, a.SESSION_SERIAL#, a.inst_id,a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME
    it gives the output
    SESSION_ID
    SESSION_SERIAL#
    START_TIME
    END_TIME
    INST_ID
    BLOCKING_SESSION
    USER_ID
    SQL_TEXT
    EVENT
    OBJECT_NAME
    MAX(A.SAMPLE_TIME)-MIN(A.SAMPLE_TIME)
    369
    45,849
    9/4/2013 8:29:33.119 AM
    9/4/2013 11:40:27.508 AM
    1
    554
    173
    SELECT POL.UNIT_PRICE   FROM PO_LINES POL  WHERE POL.PO_LINE_ID = :b1
    enq: TX - row lock contention
    PO_LINES_ALL
    +00 03:10:54.389000
    554
    18,872
    9/4/2013 8:29:33.119 AM
    9/4/2013 11:40:27.508 AM
    1
    365
    173
    SELECT POL.UNIT_PRICE,POL.QUANTITY,POL.UNIT_MEAS_LOOKUP_CODE,POL.AMOUNT   FROM PO_LINES POL  WHERE POL.PO_LINE_ID = :b1
    enq: TX - row lock contention
    JA_IN_PO_LINE_LOCATION_TAXES
    +00 03:10:54.389000
    572
    168
    9/4/2013 8:29:33.119 AM
    9/4/2013 11:40:27.508 AM
    1
    554
    173
    select line_location_id into :b0 from po_line_locations_all where line_location_id=:b1 for update of line_location_id
    enq: TX - row lock contention
    PO_LINE_LOCATIONS_ALL
    +00 03:10:54.389000
    581
    4,973
    9/4/2013 10:49:38.157 AM
    9/4/2013 10:50:39.259 AM
    1
    572
    173
    Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH'  where rti.interface_transaction_id = 3671265
    enq: TX - row lock contention
    RCV_TRANSACTIONS_INTERFACE
    +00 00:01:01.102000
    my problem is in the above  output among 4 which i have to delete so sove my issue.
    its very urgent for me.
    plz plz suggest me and how can i kill the session.
    thanks & regards
    pritesh ranjan
    According to the above, your session_id is 581 which is blocked by session_id 572 so you need to kill the 3rd session in the list.
    Thanks,
    Hussein

  • Infinte loop is going on how to kill the instance

    Hi friends
      In leave workflow instead of wait step i added loop and a condition container when wait step condition is put inside the conditional container and loop is set a flag when set a flag come out of the loop. The condition inside the condational container is REQ.Status = posted. But this condition is met. But still the loop is going on. I have generatated new version and deleted all the old version. Still loop is on. I also tried swwl and deleted the 1st workitem of the workflow. But still the instance is on. How to delete or kill  the instance. This is the problem in development.
    Regards
    vijay

    Hi vijay kumar,
    Yes, you are correct, since the endless loop will be procesed by the background user, it may or may not be displayed in SM50.
    The other way to kill the process is.
    1. go to sm12 with the user id wf-batch delete the running section and immediately do the process with reddy has informed you.
    Thanks and Regards
    Balaji K.

  • How to configure the applet  use Kerberos authentication

    Hi all:
    I know few about the java or applet security and hope someone can help me.
    I have a MS IIS Web server named win2003stdbase1 and it use Kerberos authentication, and the
    web server host a jar file.The client machine has jdk1.5 installed.When the client visit a html page which contains a java applet,the jre starts the applet and a dialog "Password Needed -Networking" popups.Then we input the right user name and the password,but the dialog popup again.The dialog display these message:
    Server:     win2003stdbase1/192.168.0.43
    Scheme:     ntlm
    UserName:
    Password:
    Domain:
    I suspect that the applet use the ntlm authentcation method which different from the web server,and I want it to use Kerberos authentication.How can I achieve this?
    Any suggestion or idear will be appreciated.Thanks.

    Are there anyone can help on this? It is a urgent issue. Also if I did not explain it clearly, please let me know.Thanks.

  • How to sign the applet with verisign certificate?

    Hi,
    I got a test certificate from the Verisign.
    Now I want to know, how to sign my applet with that certificate?
    Thanks,
    Siva E.

    Hi!
    You have to create a keystore wich contains the certificate. I think you call keystore -import "verisign.cert"Try the command, and it will tell you what it needs.
    To do the acutal signing of an applet (jar-file), you write somehting like this:
    jarsigner  -keystore "NameOfKeystore" -keypass "PasswordToPrivKey"  -storepass "PasswordToStore" "YourJarFile.jar" "CertAlias"The cert alias is an alias you created when importing the certificate. Hope it Helps!
    Henrik

  • How to customize the applet's status bar in Oracle Forms 9i

    I extended the statusBar class to include our own message in the applet's status bar. Using JDeveloper I compiled the class and jared the class file. Eventhough I placed that jar file in the classpath, it is not shown in the "import java classes" dialog box.Could anyone help me. Thanks in advance.

    Hi,
    it needs to be in the path configured in the Forms_Builder_Classpath registry variable.
    Frank

  • How to kill the process running on specific port in Solaris 10

    Hi
    As I want to kill the proces running on port 8080 in my solaris 10 box. is there any command to do the same.
    Thanks
    Rajan

    A quick google, found lots of scripts... I found the script below @ Christopher Hubbell's blog - I've modified it to pump out the command name.
    ---->>>>>>BUT let's just say it would be quicker to got to sunfreeware.com and download lsof.
    the 'lsof -i " option will give you the process id, which you can use kill _pid_ to kill the id.
    Christopher's modded script (my edits in bold):
    #!/bin/sh
    if [ `/usr/xpg4/bin/id -u` -ne 0 ]; then
    echo "ERROR: This script must run as root to access pfiles command."
    exit 1
    fi
    if [ $# -eq 1 ]; then
    port=$1
    else
    printf "which port?> "
    read port
    echo "Searching for processes using port $port...";
    echo
    fi
    for pid in `ps -ef -o pid | tail +2`
    do
    foundport=`/usr/proc/bin/pfiles $pid 2>&1 | grep "sockname:" | egrep "port: $port$"`
    if [ "$foundport" != "" ];
    then
    pname=`ps -ef -o pid -o comm |grep $pid| awk '{print $2}'`
    echo "process name: $pname, $foundport"
    fi
    done
    exit 0
    Tom de

  • HOW TO RUN THE APPLET IN JAR?

    Hi,
    I have an simple applet . I have created the jar file for the applet using the jar utility.
    1. I would Like to make my applet run simply by double clicking of the jar file.
    2. I have included in the manifest file manifest.inf the main-class file.
    3. When I double click I get the message failed to load the main-class
    Can anyone help
    G.Thirukumaran

    As an Applet does not have a method main, then obviously you need to convert it to an application, which does.

  • How to run the applet in JSP

    hi,
    im trying to run an applet from JSP i am not able to see the output of the applet on the JSP page?
    <APPLET CODE="com.metro.supex.admin.SampleApplet.class" HEIGHT="25" WIDTH="125" ALIGN="bottom"></APPLET>
    this line of code is included in JSP to run the applet, it is giving error
    java.lang.ClassNotFoundException:com.metro.supex.admin SampleApplet
    please can you help me in this matter.

    And don't use the applet tag, use object embed.
    use the htmlconverter in the jdk bin dir to convert an applet tag.

Maybe you are looking for