What is the problem with this simple code?

import javax.swing.*;
public class TestThread extends JApplet implements Runnable
JPanel jp;
JLabel jb;
public void init()
jp=new JPanel();
jb=new JLabel("Botton");
getContentPane().add(jp);
jp.add(jb);
public static void main(String args[])
new TestThread().start();
public void run()
System.out.println("Jaison");
Y it not working...help me
contd............
<html>
<head>
</head>
<applet
code=TestThread.class
width=1450
height=1680>
</applet>
</html>

Status bar says
Applet TestThread StartedYou do know that main isn't used by applets? It will not be executed by the browser.
Kaj

Similar Messages

  • What is the problem with this simple script

    This shouls work to open safari:
    tell application "Safari"
      activate
    end tell
    But I get error:
    error "Safari got an error: Connection is invalid." number -609
    So what is wrong? Other apps work such as:
    tell application "Adobe Bridge CS6"
      activate
    end tell

    Ah the Devils in the details.
    With the quit like that there is the potential for error.  When I add the quit I see either Safari not opening or else I get the connection error also.
    There are ways around this either put in a delay between the quit and the activate or else superficially check to see if Safari has quit.
    so
    tell application "Safari" to quit
    repeat while application "Safari" is running
    end repeat
    tell application "Safari"
      activate
    end tell
    or
    tell application "Safari" to quit
    delay 5 -- increase or decrease as needed
    tell application "Safari"
         activate
    end tell

  • What's the problem with this Ajax code?

    The B.cfm:
    <cfimport taglib="/tags" prefix="Tag">
    <Tag:_ImportprocessingTime>
    <!--- This tag show the time spended--->
    do some long loop......
    <!--- this only needs about 5 seconds--->
    </Tag:_ImportprocessingTime>
    the ajax code to execute the b.cfm:
    function Importxls(url,buttonid,msgid,dbffilename)
    createXMLHttpRequest();
    var url=url+"?importdbffilename="+dbffilename+"&ti="+new
    Date().getTime();
    xmlHttp.open("GET",url,true);
    xmlHttp.onreadystatechange= function()
    if (xmlHttp.readyState < 4)
    document.getElementById(msgid).innerHTML= "importing......";
    document.getElementById(buttonid).disabled=true;
    else if (xmlHttp.readyState == 4)
    if(xmlHttp.status == 200)
    document.getElementById(msgid).innerHTML=xmlHttp.responseText;
    document.getElementById(buttonid).disabled=false;
    else if (xmlHttp.status == 404)
    document.getElementById(msgid).innerHTML="URL error";
    document.getElementById(buttonid).disabled=false;
    else
    document.getElementById(msgid).innerHTML="error,xmlHttp
    state:"+xmlHttp.status+"。";
    document.getElementById(buttonid).disabled=false;
    xmlHttp.send(null);
    when I execute the b.cfm ,the spended time only about
    5 seconds and show the result right now.
    but when I execute the b.cfm through the ajax
    code,after about 60 seconds,it shows the result,why?and how
    to let it show the result after the b.cfm executed?
    Thanks a lot.

    up

  • Please tell me what is the problem with this code

    Hai,
    Iam new to Swings. can any one tell what is the problem with this code. I cant see those controls on the frame. please give me the suggestions.
    I got the frame ,but the controls are not.
    this is the code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ex2 extends JFrame
    JButton b1;
    JLabel l1,l2;
    JPanel p1,p2;
    JTextField tf1;
    JPasswordField tf2;
    public ex2()
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setTitle("Another example");
    setSize(500,500);
    setVisible(true);
    b1=new JButton(" ok ");
    p1=new JPanel();
    p1.setLayout(new GridLayout(2,2));
    p2=new JPanel();
    p2.setLayout(new BorderLayout());
    l1=new JLabel("Name :");
    l2=new JLabel("Password:");
    tf1=new JTextField(15);
    tf2=new JPasswordField(15);
    Container con=getContentPane();
    con.add(p1);
    con.add(p2);
    public static void createAndShowGUI()
    ex2.setDefaultLookAndFeelDecorated(true);
    public static void main(String ar[])
    createAndShowGUI();
    new ex2();
    }

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ex2 extends JFrame
        JButton b1;
        JLabel l1,l2;
        JPanel p1,p2;
        JTextField tf1;
        JPasswordField tf2;
        public ex2()
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setTitle("Another example");
            b1=new JButton(" ok ");
            p1=new JPanel();
            p1.add(b1);
            p2=new JPanel();
            p2.setLayout(new GridLayout(2,2));
            l1=new JLabel("Name :");
            l2=new JLabel("Password:");
            tf1=new JTextField(15);
            tf2=new JPasswordField(15);
            p2.add(l1);
            p2.add(tf1);
            p2.add(l2);
            p2.add(tf2);
            Container con=getContentPane();
            con.add(p1, BorderLayout.NORTH);
            con.add(p2, BorderLayout.CENTER);
            pack();
            setVisible(true);
        public static void createAndShowGUI()
            ex2.setDefaultLookAndFeelDecorated(true);
        public static void main(String ar[])
            createAndShowGUI();
            new ex2();
    }

  • Vector, what is the problem with this code?

    Vector, what is the problem with this code?
    63  private java.util.Vector data=new Vector();
    64  Vector aaaaa=new Vector();
    65   data.addElement(aaaaa);
    74  aaaaa.addElement(new String("Mary"));on compiling this code, the error is
    TableDemo.java:65: <identifier> expected
                    data.addElement(aaaaa);
                                   ^
    TableDemo.java:74: <identifier> expected
                    aaaaa.addElement(new String("Mary"));
                                    ^
    TableDemo.java:65: package data does not exist
                    data.addElement(aaaaa);
                        ^
    TableDemo.java:74: package aaaaa does not exist
                    aaaaa.addElement(new String("Mary"));Friends i really got fed up with this code for more than half an hour.could anybody spot the problem?

    I can see many:
    1. i assume your code snip is inside a method. a local variable can not be declare private.
    2. if you didn't import java.util.* on top then you need to prefix package on All occurance of Vector.
    3. String in java are constant and has literal syntax. "Mary" is sufficient in most of the time, unless you purposly want to call new String("Mary") on purpose. Read java.lang.String javadoc.
    Here is a sample that would compile...:
    public class QuickMain {
         public static void main(String[] args) {
              java.util.Vector data=new java.util.Vector();
              java.util.Vector aaaaa=new java.util.Vector();
              data.addElement(aaaaa);
              aaaaa.addElement(new String("Mary"));
    }

  • I was playing candy crush and I had too much problem with my bill your charge too much I want to know what is the problem with this game cost

    HELLO
    I was playing candy crush and I had too much problem with my bill your charge too much I want to know what is the problem with this game cost

    Take it up with iTunes Support - we are not Apple here, we are just users like you:
    http://www.apple.com/support/itunes/ww/
    Cheers,
    GB

  • What is the problem with this Stored Procedure

    Hi ,
    What is the problem with this Stored Procedure ?Why is it giving errors ??
    CREATE or replace  PROCEDURE getEmpName
    *(EMP_FIRST OUT VARCHAR2(255))*
    BEGIN
    SELECT ename INTO EMP_FIRST
    FROM Emp
    WHERE EMPNO = 7369;
    END ;
    */*

    You don't specify precision in procedure arguments.
    (EMP_FIRST OUT VARCHAR2(255))should be
    (EMP_FIRST OUT VARCHAR2)Since you asked what's wrong with it, I could add that it needs formatting and the inconsistent use of upper and lower case is not helping readability.

  • What is the problem with this code ? Race condition??

    Guys,
    The idea behind the attached code is quite simple.
    I have a 2D parent array. First, I print a subset of this array into a table control (based on a sensor selection). Now, I want edit the numbers in the table. I need the changes to be reflected in the table and the parent 2D array. (In simple terms, this is like replacing the the edited array subset into the parent 2D array)
    The problem is when I change(edit) any entry in the table, the entry changes back to its original value. The change doesnt seem to be reflecting on the parent 2D array and the table. .
    Can anyone tell me where the problem is?
    Thanks
    Ravi
    Solved!
    Go to Solution.
    Attachments:
    Alarm threshold test.vi ‏14 KB

    I agree with Chris, here's an idea (of whatI think your code does):
    The case structure in your code was unnecessary, all the cases were the same so I removed them.
    The sequence structure was unnecessary.
    Ton
    Message Edited by TonP on 11-20-2008 07:52 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Alarm threshold test_BD.png ‏19 KB

  • What is the problem with this Xcopy in PostBuild?

    I am having the following post-build command in a Visual Studio project:
    xcopy  $(ProjectDir)Data $(OutDir)\
    The Data is a directory in the project folder which I want to have copied to bin/debug or bin/release after build completes successfully.
    I am getting an error as below:
    The command "xcopy  E:\Lavanya Deepak\Projects\matrimonial\Data bin\Debug\" exited with code 4.

    Why are you using Xcopy for something that Visual Studio can do already?
    http://support.microsoft.com/kb/306234
    http://msdn.microsoft.com/en-us/library/0c6xyb66%28v=vs.80%29.aspx
    Besides, this is a issue with XCOPY, not with Visual C# or Visual Studio (wich this forum is about). Perhaps you better look into the documentation or ask in a admin Forum?
    -1 for not an answer to the question.
    This does not address the need for XCOPY. This is NOT an answer. How does this help transfer *.ascx files along with the compiled code behind into the respective directories of a local website for debugging.  Umbraco requires this as an example.
    Also, this could be an issue with Visual studio as the XCOPY works in VS 2012 and via the command prompt but NOT VS 2013 for me.

  • Custom tables create in Apps schema ( What are the problems with this?)wwww

    Hello all,
    I'm a dba in a new environment where a number of custom schemas are being created in the apps schema. I know this is not considered Oracle's best practice and I would like to make some recommendations for a change. Before doing so, I would like to know the problems that are associated with custom tables living in the apps schema. We are currently on 11.5.10.2 on AIX. Also, if someone can point me to any "Official" customization standard or Oracle documention where I can backup my case it would be greatly appreciated.
    Thanks in advance,

    Hi,
    Please see this thread.
    Custom application implemented in E-bussiness Suite
    Re: Custom application implemented in E-bussiness Suite
    Regards,
    Hussein

  • What's the problem with this CC stuff?

    Since CC is available I only have trouble with all this stuff. I'm on OSX ML and there seems to be no change to install anything of the new stuff. CC app desktop- failed to install. When I use AAM, the CC apps are available, but after downloading I get an installation failure (15). I've tried anything discussed in this community, but nothing worked. So why there are so many problems with CC? Since I pay over 60 Euros each month, I would like to use the promised applications. ADOBE, please supply a reliable solution for all operating systems without the need of erase data, rename folders or anything else. Thanks in advance.

    1hausl1 I would recommend you contact our support team and work with them directly.  You can contact our chat support at http://adobe.ly/yxj0t6.

  • What is the problem with this script. it is giving invalid table name error

    declare
    l_cnt number;
    v_sql varchar2(1000);
    table_name1 varchar2(1000);
    begin
    for i in ( select table_name from all_tables )
    loop
    table_name1 := i.table_name;
    v_sql := 'select count(1) from :table' ;
    execute immediate v_sql into l_cnt using table_name1;
    dbms_output.put_line(l_cnt);
    end loop;
    end;

    the problem is that you can't do that. it's illegal. use dynamic sql.
    http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96624/11_dynam.htm#10961
    see a million other thread here, including this one posted 12 minutes before yours
    Passing Parameter to From clause of SQL

  • What is the problem with this trigger

    please tell me why this trigger is not working , i tried to complile it but its giving the error!
    the format is ...
    create or replace trigger log_off
    BEFORE LOGOFF ON database
    begin
    insert into log_trigg_table
    values(user,sysdate,'LOGED ON');
    END LOG_OFF;
    and the error is
    BEFORE LOGOFF ON database
    ERROR at line 2:
    ORA-04072: invalid trigger type
    can you tell me the rreason
    one this i forgot to tell you that i am using oracle 8.0.6
    umair sattar
    null

    valid trigger types are BEFORE/AFTER
    INSERT/UPDATE/DELETE on TABLE

  • Can you figure out what was the problem in this simple 3 liner code?

    Hello, below is a class to demonstrate a problem I see that I can't understand. I create an instance of the enclosing
    class at class level, another instance in static main method. Class below fails at run time with stack overflow exception. It's all fine if one of those two instantiation steps is removed, What is wrong can anyone any ideas?
    public class App
    // create instance of this class     
    App app = new App();
    public static void main( String[] args )
         // create instance of this class again.
    App app2 = new App();
    System.out.println( "Hello World!" );
    }

    As soon as a new instance of 'App' is created, 'App app = new App();' is called, which calls 'App app = new App();' etc. Hence the stack overflow.
    When you remove 'App app = new App();', obviously, the stack overflow does not occur. And when your remove 'App app2 = new App();' the 'App' class is never instantiated and therefore, the exception is also not thrown.

  • What is the problem with this code?

    dear sirs...
    i have a page that does not contain any binding, it contains the following event:
    public void onCheck(DataActionContext ctx)
    ViewObject V=ctx.getBindingContext.findDataControl("AppModuleDataControl").getApplicationModule.findViewObject("empview1");
    V.setWhereClause("");
    V.executeQuery();
    V.first();
    note that the above code works if the table emp is on the page, however, if the page is not bound to the page (it does not contains the table) the statement in the bold will fire an exception saying that there is no binding. i am sure the V is not set to null.
    another problem appears, if i put the table and execute it within jdeveloper, it works correctly, however, if i run if i deploy the application into application server, the code never runs as if there is some kind of an error.
    i hope that you can anser me about the following;
    1- if the code above correct?
    2- how can i view the log for the application?
    3- System.out.println("test"); in jdeveloper works okay, in the application server, does it cause some kind of an error?
    thanks for any help & best regards

    If you don't close the ResultSet, different things happen based on which database you're running. You can keep read locks that you don't need. It wastes resources, and as different databases react differently to it, you might have weird bugs down the road that result from your practices of not properly closing ResultSets, PreparedStatements, and Connections. Put this in a loop like you've got here, and the effects may or may not get amplified.
    I write a close() for a ResultSet just as soon as I open it, just to make sure I don't forget. In a situation like this one, I would write something like so:
    for(int i = 0;i<someValue;i++)
    try
    //some code
    rs = pstmt.executeQuery();
    //some code that uses rs
    catch(Exception e)
    finally
      if (rs != null)
        rs.close();
      if (pstmt != null)
        pstmt.close();
    }

Maybe you are looking for

  • Can't delete event from iCloud

    I had a recurring event in one of my iCloud calendars. No matter what I do -- on iCloud or from within iCal -- from deleting each event manually to deleting all at the very beginning and all Future Events, it won't delete. It keeps coming back. The o

  • Error while running report in DocViewer region through OAF .

    I am trying to run a report , on my custom region embedded in seeded page of service request module. I have extended region : "/oracle/apps/xdo/oa/common/webui/DocumentViewerRn.MainRegion" I followed the steps in this thread : http://apps2fusion.com/

  • YouTube is no longer showing up

    Don't know when this happened. I have a 160GB AppleTV. I updated a while ago to 1.1, and have watched YouTube on it before. I checked today, and YouTube is not there. I can connect to the Apple Store for movie trailers, popular music videos, etc. No

  • I cannot load certain pages using FireFox i could days ago. Pages load fine IE.

    I use google doc to link me to pages/spreadsheets for work, and i was accessing everything fine till 5 days ago. Now i am being redirected. I get a glimpse of the page/spreadsheet then it begins to redirect me with a blank screen. Disabled Java Add o

  • CID or ContractID for Firefox PDF Plug-in XPCOM (XPT)

    Can anyone at Adobe tell me the CID / ContractID for the Web2PDF Firefox plug-in for the XPCOM (IWeb2PDFComponent.xpt) component? For some reason, the XPT isn't loading and I wanted to try it by CID. web2pdfcomp_cinst = Components.classes["@adobe.com