A JFrame calling another JFrame running a Thread

Hi,
here is my problem: I have an instance of Frame1 (extending JFrame) containing a button. When this button is clicked, a new instance of Frame2 (extending JFrame too) is created. The constructor of this Frame2 then calls the run method of an implementation of Runnable (called MyThread). For the purpose of this example I put a simple incrementation of a counter in the run method of the thread.
The goal is to stop the incrementation by clicking anytime on the stop button of Frame2, hence ending the thread.
When I create a new instance of Frame2, it works fine and I am able to end the thread, but when I create an instance of Frame1, the application freezes and I don't get any control on Frame2.
The code for those classes is:
public class Frame1 extends JFrame implements ActionListener{
     public static void main(String[] args) {
          new Frame1();
     public Frame1(){
          getContentPane().setLayout(new GridLayout(1,1));
          JButton b = new JButton("Run");
          b.addActionListener(this);
          getContentPane().add(b);
          setVisible(true);
          setSize(400,400);          
     public void actionPerformed(ActionEvent e) {
          Frame2 f= new Frame2();
public class Frame2 extends JFrame implements ActionListener{
     MyThread t;
     boolean running = true;
     public Frame2(){
          getContentPane().setLayout(new GridLayout(1,1));
          JButton b = new JButton("Stop");
          b.addActionListener(this);
          getContentPane().add(b);
          setVisible(true);
          setSize(200,200);          
          t = new MyThread();
          t.run();
     public void actionPerformed(ActionEvent e) {
          t.setRunning(false);
public class MyThread implements Runnable{
     boolean running = true;
     public void run(){
          int count = 0;
          while(isRunning())
               count++;
          System.out.println("Last count: "+count);
     public boolean isRunning() {
          return running;
     public void setRunning(boolean running) {
          this.running = running;
One thing I have tried is to make Frame2 implementing Runnable, but it didn't work. Any idea how to get the control on Frame2?
Thanks

You are calling t.run() and you really should be using t.start(). The code inside run() in MyThread is not running in a separate thread, so the call that you make to t.run() never returns.

Similar Messages

  • WebDynpro calling another WebDynpro running on a different System

    Hi,
    I have a two WebDynpro components(WDComp1 and WDComp2) running on two different WAS Server (System1 and System2). I want to call WDComp2 running on System2 from WDComp1 running on System1.
    Any suggestions are appericated.
    Thanks in advance

    I think the only way you may call maybe through a URL to the second application

  • Compiling a class calling another class

    Hi,
    I have a problem with running an applet.
    my applet contains a thread and calls another class.
    when i compile it with javac, it says "cannot resolve symbol class Compute" which is the name of the other class.
    thank you for your help.

    Hi friend,
    How you solved this problem? can u please explain me
    too...
    I've an error while compiling my java file. cannot
    resolve symbol : class Student.
    where my two java files are...
    StudentBean.java
    public class StudentBean
    public static void main(String args[])
    Student s = new Student();
    Student.java
    public class Student
    String id,name;
    public Student(String id,String name)
    this.id = id;
    this.name = name;
    Both are in the same folder, please help me out of it.
    Thanking you,
    Harshavardhan.I do not know about the symbol resolution. But you do not have a default constructor in Student which may be causing an issue with the compile.

  • How can i call another view variables in another view

    how can i call another view variables in another view and pass that variables to the function
    my situation is i have a view FAC which i need to pass par_id_fac TO THE VIEW AGR.AFTER THAT i what to take start_dt in agr view and par_id_fac from Fac and pass this variables to the function i have check the documentation but does not do what i what,the doc simply talk about creating variables and pass then to function.i what to pass variables from the views and return value to my contractno Variables value
    something like if :agr.contract_no is null
    and :agr.agr_start_dt is not null then
         :agr.contract_no := sms_fapp.get_contract_no(:fac.par_id_fac,:agr.agr_start_dt);
    end if;     
    y view is
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="AGR"
      Version="11.1.2.60.81"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full"
      UseGlueCode="false"
      RowClass="sms1405.AGRRowImpl"
      ComponentClass="sms1405.AGRImpl"
      DefClass="sms1405.AGRDefImpl">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_codeGenFlag2" Value="Access|Def|Coll|Prog|VarAccess"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
    <SQLQuery><![CDATA[SELECT SmsAgreements.ID,
           SmsAgreements.FAPP_ID,
           SmsAgreements.PAR_ID,
           SmsAgreements.SSCH_ID,
           SmsAgreements.COSERV_ID,
           SmsAgreements.IREA_ID_TERMINATED,
           SmsAgreements.IREA_ID_SUSPENDED,
           SmsAgreements.SPTYP_ID,
           SmsAgreements.CLAIM_BASED_YN,
           SmsAgreements.NOTES,
           SmsAgreements.SUSPENSION_DT,
           SmsAgreements.TERMINATION_DT,
           SmsAgreements.SPECIAL_PROJECT_END_DT,
           SmsAgreements.CAPITAL_FUNDING_APPROVED,
           SmsAgreements.PERIODICAL_PAYMENT_AMOUNT,
           SmsAgreements.DATE_CREATED,
           SmsAgreements.DATE_MODIFIED,
           SmsAgreements.MODIFIED_BY,
           SmsAgreements.CREATED_BY,
           SmsAgreements.CONTRACT_NO,
           SmsAgreements.OFF_ID,
           SmsAgreements.DATE_APPROVED,
           SmsAgreements.AGR_START_DT,
           SmsAgreements.AGR_END_DT,
           SmsAgreements.MONTHS_FUNDED,
           SmsAgreements.PFRE_ANNUAL_FREQUENCY,
           SmsAgreements.FUNDED_NO,
           SmsAgreements.REGISTERED_NO,
           SmsAgreements.CONTRACT_NAME,
           SmsAgreements.OPEX_ALLOCATION,
           SmsAgreements.EMERG_ORG_YN,
           SmsAgreements.SCHEDULE,
           SmsAgreements.PERIODICAL_PAYMENT_AVERAGE,
           SmsAgreements.NO_OF_PAYMENTS,
           SmsAgreements.ADVANCE_PAYMENT_PERCENT,
           SmsAgreements.QUALIFY_NO,
           SmsAgreements.ENROLLED_NO,
           SmsAgreements.MULTI_YEAR_ALLOCATION,
           SmsAgreements.AGR_ID_SOURCE,
           SmsAgreements.FYEA_YEAR_ACTIVE,
           SmsAgreements.PTYPE_CODE,
           SmsAgreements.CONTRACT_VALUE,
           SmsAgreements.MAGR_ID,
           SmsAgreements.PROG_ID,
           SmsAgreements.EMERGENCY_BED_#,
           SmsAgreements.drep_id,
           SmsAgreements.srep_id,
           (select name from sms_offices off where off.id = SmsAgreements.off_id)officeName,
           (SELECT  PROG.NAME FROM   sms_programmes prog where PROG.ID = SMSAGREEMENTS.PROG_ID)programe,
           (select prog.code || '.' || bvspro.code || '  ' || bvspro.NAME budget_vote   from sms_subsidy_schemes ssch,
              sms_budget_vote_sub_programs bvspro,
              sms_programmes prog
              WHERE bvspro_id = bvspro.ID AND prog.ID = prog_id
              and prog.id = SMSAGREEMENTS.PROG_ID)Sub_programme,
             (select  ssch.NAME from sms_subsidy_schemes ssch where SSCH.ID = SMSAGREEMENTS.SSCH_ID)subsidy,
           (SELECT master_contract FROM  sms_master_agreements magr WHERE MAGR.ID = SmsAgreements.magr_id)masterContract
    FROM SMS_AGREEMENTS SmsAgreements]]></SQLQuery>
      <ViewAttribute
        Name="ContractNo"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        Precision="20"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="CONTRACT_NO"
        SQLType="VARCHAR">
        <TransientExpression><![CDATA[CONTRACT_NO]]></TransientExpression>
        <DesignTime>
          <Attr Name="_DisplaySize" Value="20"/>
        </DesignTime>
      </ViewAttribute>
    <ViewAttribute
        Name="AgrStartDt"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.sql.Timestamp"
        ColumnType="DATE"
        AliasName="AGR_START_DT"
        SQLType="DATE">
        <RecalcCondition><![CDATA[true]]></RecalcCondition>
        <TransientExpression><![CDATA[adf.currentDate]]></TransientExpression>
      </ViewAttribute>
    </ViewObject>and my FAC view is
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="FAC"
      Version="11.1.2.60.81"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full"
      UseGlueCode="false">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
      </DesignTime>
      <SQLQuery><![CDATA[SELECT SmsFacilityVw.PAR_ID_ORG,
           SmsFacilityVw.ORGANISATION,
           SmsFacilityVw.ORG_KEY,
           SmsFacilityVw.C_CODE,
           SmsFacilityVw.FACILITY,
           SmsFacilityVw.PAR_ID_FAC,
           SmsFacilityVw.NPO_REGISTRATION_NO,
           SmsFacilityVw.ADDRESS,
           SmsFacilityVw.TELNR_WORK,
           SmsFacilityVw.ADDRESSLINE,
           SmsFacilityVw.Town,
           SmsFacilityVw.Suburb,
           SmsFacilityVw.PostalCode,
           SmsFacilityVw.DSD_REGION,
           SmsFacilityVw.SERVICE_DELIVERY_AREA,
           SmsFacilityVw.FAXNR,
           SmsFacilityVw.EMAIL,
           SmsFacilityVw.PAR_TYPE_DEF
    FROM SMS_FACILITY_VW SmsFacilityVw]]></SQLQuery>
      <ViewAttribute
        Name="ParIdOrg"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="PAR_ID_ORG"
        Expression="PAR_ID_ORG"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Organisation"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ORGANISATION"
        Expression="ORGANISATION"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="OrgKey"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="10"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ORG_KEY"
        Expression="ORG_KEY"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="10"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="CCode"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="30"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="C_CODE"
        Expression="C_CODE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="30"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Facility"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="FACILITY"
        Expression="FACILITY"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="ParIdFac"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="PAR_ID_FAC"
        Expression="PAR_ID_FAC"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="NpoRegistrationNo"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="30"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="NPO_REGISTRATION_NO"
        Expression="NPO_REGISTRATION_NO"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="30"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Address"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="227"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS"
        Expression="ADDRESS"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="227"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="TelnrWork"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="150"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="TELNR_WORK"
        Expression="TELNR_WORK"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="150"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Addressline"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="120"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESSLINE"
        Expression="ADDRESSLINE"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="120"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Town"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="TOWN"
        Expression="TOWN"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Suburb"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="SUBURB"
        Expression="SUBURB"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Postalcode"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="4"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="POSTALCODE"
        Expression="POSTALCODE"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="4"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="DsdRegion"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="40"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="DSD_REGION"
        Expression="DSD_REGION"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="40"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="ServiceDeliveryArea"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="50"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="SERVICE_DELIVERY_AREA"
        Expression="SERVICE_DELIVERY_AREA"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="50"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Faxnr"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="50"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="FAXNR"
        Expression="FAXNR"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="50"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Email"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="80"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="EMAIL"
        Expression="EMAIL"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="80"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="ParTypeDef"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="12"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="PAR_TYPE_DEF"
        Expression="PAR_TYPE_DEF"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="12"/>
        </DesignTime>
      </ViewAttribute>
      <ViewLinkAccessor
        Name="AGR"
        ViewLink="sms1405.par_facfkViewLink"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
      <ViewLinkAccessor
        Name="SmsParAddrVwView"
        ViewLink="sms1405.parLink"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
      <ViewLinkAccessor
        Name="DOC"
        ViewLink="sms1405.FAC_DOC"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
    </ViewObject>Edited by: ADF007 on 2012/08/23 6:10 PM

    i try this
    public class SMS_AGREEMENTSImpl extends EntityImpl {
    RowSet newContractNoBeforePost = null;
        public static int NUMBER = Types.NUMERIC;
        public static int DATE = Types.DATE;
        public static int VARCHAR2 = Types.VARCHAR;
      protected Object callStoredFunction(int sqlReturnType, String stmt,
            Object[] bindVars) {
            CallableStatement st = null;
            try {
            // 1. Create a JDBC CallabledStatement
            st = getDBTransaction().createCallableStatement(
            "begin ? := "+stmt+";end;",0);
            // 2. Register the first bind variable for the return value
            st.registerOutParameter(1, sqlReturnType);
            if (bindVars != null) {
            // 3. Loop over values for the bind variables passed in, if any
            for (int z = 0; z < bindVars.length; z++) {
            // 4. Set the value of user-supplied bind vars in the stmt
            st.setObject(z + 2, bindVars[z]);
            // 5. Set the value of user-supplied bind vars in the stmt
            st.executeUpdate();
            // 6. Return the value of the first bind variable
            return st.getObject(1);
            catch (SQLException e) {
            throw new JboException(e);
            finally {
            if (st != null) {
            try {
            // 7. Close the statement
            st.close();
            catch (SQLException e) {}
        protected void doDML(int operation, TransactionEvent e) {
           String amDef = "sms1405.sms1405Module";
           String config = "sms1405ModuleShared";
              String NewContract = null;                 
            ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
            ViewObjectImpl vo = (ViewObjectImpl) am.findViewObject("AGR1");
            vo.executeQuery();
            Row row = vo.first();
            // NewContract = (String)vo
            NewContract = (String)row.getAttribute("ContractNo");
            SMS_AGREEMENTSImpl newcont = new SMS_AGREEMENTSImpl();
           //AGRRowImpl res = new  AGRRowImpl();
           // NewContract = NewContractNo();
            if (operation == 1)  {
                         newcont.setContractNo(NewContractNo());
                         //res.setContractNo( NewContractNo());   
                        //NewContractNo();
            super.doDML(operation, e);
            public void postChanges(TransactionEvent TransactionEvent) {
            /* Only bother to update references if contractno is a NEW one */
            if (getPostState() == STATUS_NEW) {
            * Get a rowset of contract related
            * to this new partyaddress before calling super
             newContractNoBeforePost  = (RowSet)getSMS_AGREEMENTS();
            super.postChanges(TransactionEvent);
        public Date getAgrStartDt() {
            return (Date)getAttributeInternal(AGRSTARTDT);
         * Sets <code>value</code> as the attribute value for AgrStartDt.
         * @param value value to set the AgrStartDt
        public void setAgrStartDt(Date value) {
            setAttributeInternal(AGRSTARTDT, value);
        public String NewContractNo() {
               String amDef = "sms1405.sms1405Module";
               String config = "sms1405ModuleShared";
               String NewContract = null;                 
               ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
               ViewObjectImpl vo = (ViewObjectImpl) am.findViewObject("FAC1");
               // vo.setWhereClause("ParIdFac = 38844");
                vo.executeQuery();
                Row row = vo.first();
               Integer par_id = null;
               //oracle.jbo.domain.Date today = new oracle.jbo.domain.Date(oracle.jbo.domain.Date.getCurrentDate());
               oracle.jbo.domain.Date today = new oracle.jbo.domain.Date();
               //FACRowImpl res = new FACRowImpl();
               //res.setParIdFac(par_id);
               par_id = (Integer)row.getAttribute("ParIdFac");
               today = this.getAgrStartDt();
           return (String)callStoredFunction(VARCHAR2,
           "sms_fapp.get_contract_no(?,?)",
           new Object[]{par_id,today});
    }at the moment am geting this error
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
         at oracle.adf.model.binding.DCBindingContainer.reportException(DCBindingContainer.java:415)
         at oracle.adf.model.binding.DCBindingContainer.reportException(DCBindingContainer.java:477)
         at oracle.adf.model.binding.DCControlBinding.reportException(DCControlBinding.java:201)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.reportException(JUCtrlActionBinding.java:2007)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1659)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
         at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
         at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
         at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.NullPointerException
         at oracle.jbo.server.EntityImpl.getEntityCache(EntityImpl.java:4665)
         at oracle.jbo.server.EntityImpl.saveEventOrigTransAttrVals(EntityImpl.java:729)
         at oracle.jbo.server.EntityImpl.saveEventOrigAttrVals(EntityImpl.java:719)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1935)
         at sms1405.SMS_AGREEMENTSImpl.setContractNo(SMS_AGREEMENTSImpl.java:998)
         at sms1405.SMS_AGREEMENTSImpl.doDML(SMS_AGREEMENTSImpl.java:1628)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6751)
         at sms1405.SMS_AGREEMENTSImpl.postChanges(SMS_AGREEMENTSImpl.java:1645)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3264)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3067)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2071)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
         ... 43 more
    ## Detail 0 ##
    java.lang.NullPointerException
         at oracle.jbo.server.EntityImpl.getEntityCache(EntityImpl.java:4665)
         at oracle.jbo.server.EntityImpl.saveEventOrigTransAttrVals(EntityImpl.java:729)
         at oracle.jbo.server.EntityImpl.saveEventOrigAttrVals(EntityImpl.java:719)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1935)
         at sms1405.SMS_AGREEMENTSImpl.setContractNo(SMS_AGREEMENTSImpl.java:998)
         at sms1405.SMS_AGREEMENTSImpl.doDML(SMS_AGREEMENTSImpl.java:1628)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6751)
         at sms1405.SMS_AGREEMENTSImpl.postChanges(SMS_AGREEMENTSImpl.java:1645)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3264)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3067)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2071)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
         at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
         at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
         at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  • How to call another form ,if option is entered in a text item object ???

    hi ,
    I am created an application ,where in i press a button which call another form having a menu .
    I select any one of the option from the menu ....i enter a number in the text item object of this form ....depending upon what option i have typed .....i would like to call another form ...
    My questions are
    1) Which trigger of this text item should be enabled,and what code to i write in this trigger ?
    2) Since this form is not having any database insert,delete ,update or query (select)
    it should directly go to the new form,whose option i provide in the text item .
    Sunny

    hey bro, i am assuming that ur text item contains the form name, any relevant trigger can be used for user action, like key-enter, post-change or key-next-item.
    to run a form u can use functions call_form or open_form with proper paramters.
    if u want to forward the entered text in the item, use global variable for the session.
    it doesnt matter if the form contains database items or blocks, all u have to do is run the form.
    e.g,
    declare
    VAR VARCHAR2-------;
    begin
    /* u can use the variable to concatinate or modify too, also can use global variable
    var:=:urblock.uritem;
    /* use ur own relevant parameters */
    open_form(VAR,ACTIVATE,NO_SESSION);
    exception
    when---------
    end;

  • How to run a thread for second time ?

    I have a written a ThreadPool, but I found that basically a thread is not running for the second time. i.e First i call run() method and call stop(). If i call again run() method for the same thread, it is not running. What should I do, If i want to run the thread for the second time ?
    class NewThread implements Runnable {
    String name;
    NewThread(String a) {
    name=a;
    public void run() {
    try{
    for(int i=0;i<5;i++) {
    System.out.println("Thread :" + name + " #" +i);
    Thread.sleep(5);
    catch (Exception e) {
    e.printStackTrace();
    class threadRunnableTest {
    public static void main (String args[]) {
    Runnable runnable=new NewThread("BaSkAr");
    Thread thread = new Thread(runnable);
    try{
    System.out.println("First Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("First Thread it to be stopped!!");
    thread.stop();
    System.out.println("Second Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("Second Thread it to be stopped!!");
    thread.stop();
    catch (Exception e) {
    e.printStackTrace();

    baskark wrote:
    I have a written a ThreadPool, but I found that basically a thread is not running for the second time. i.e First i call run() method and call stop(). If i call again run() method for the same thread, it is not running. What should I do, If i want to run the thread for the second time ?
    class NewThread implements Runnable {
    String name;
    NewThread(String a) {
    name=a;
    public void run() {
    try{
    for(int i=0;i<5;i++) {
    System.out.println("Thread :" + name + " #" +i);
    Thread.sleep(5);
    catch (Exception e) {
    e.printStackTrace();
    class threadRunnableTest {
    public static void main (String args[]) {
    Runnable runnable=new NewThread("BaSkAr");
    Thread thread = new Thread(runnable);
    try{
    System.out.println("First Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("First Thread it to be stopped!!");
    thread.stop();
    System.out.println("Second Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("Second Thread it to be stopped!!");
    thread.stop();
    catch (Exception e) {
    e.printStackTrace();
    It's usually helpful to check the documentation:
    [http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#start()|http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#start()]
    start
    public void start()Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread.
    The result is that two threads are running concurrently: the current thread (which returns from the call to the start method) and the other thread (which executes its run method).
    It is never legal to start a thread more than once. In particular, a thread may not be restarted once it has completed execution.
    So, make a new java.lang.Thread

  • How to detect end of FLV Video - and then call another web page?

    I'm using Flash CS3 v9 on a PC to...
    - use File > Import an AVI video and convert it to an FLV video.
    - use File > publish to publish it.
    - Then upload the four files...
    .. MyVideo.flv
    .. MyPage.html,
    .. MyPage swf
    .. AC_RunActiveContent.js
    to my website.
    Works Great!
    My Question:
    Since Javascript seems to run the .swf file which pays the .flv video... (or some such)
    Can I use Javascript (or html) to tell when the FLV Video has finished playing...
    And then automatically call another webpage...
    If so would someone be kind enough to share a code sample with me to get me quick started.
    Thanks for any help.

    I'm using the defaults in Flash CS3 ver9.
    I'm not creating any action script myself.
    I open Flash and select from the Flash menuio options...
    "Create New Flash File (Action Script 3.0)"
    I then File | Import my AVI video to convert it to an FLV video...
    and choose the player options for controls, etc
    and then punch through the menu's until Flash finally imports the video.
    I then "Publish" the project to the the 4 files mentioned in my initial posting.
    So, I think the answer to your question is...
    Yes, I'm using the default Flash playback component to play the flv
    and yes, I'm letting Flash default to CS3 even though I'm not writing the code... Flash is.
    Thanks for the help.

  • Re-running a Thread

    Hi all,
    I have a problem with re-running a Thread. I try to reun a Thread via its start()-method. The first time everything works fine. The second time (after the Thread finishes his first execution) the run()-method is never invoked when calling start(). Is this a bug or is there no way to re-use a Thread. Do I have to construct a new Thread instead of re-using the old one?
    Thanks for any hint, Mathias

    You can only call start() once. When the thread exits its run method, then this thread is stopped and you cannot run it again.
    Take a look at the SwingWorker example on how to reuse a thread. It works something like this:
    public void run() {
      while (running) {
        // wait until a new task is received
        // run the task
    public void newTask(Runnable task) {
      // notify the thread about this new task
    public void stopThread() {
      running = false;
      // notify the thread in case it is sleeping
    }

  • Call another program in first program

    hi,
    i need to perform to call another report in my current report. so how am i going to do so?
    how report work:
    the report are going to run as background job. once the report run, it will send out the report in text file to user. and then i want it to trigger report 2. report 2 work the same, it will send another text file to user.
    and the parameter for both the report is on current date only.
    so how am i going to code in my first report program, to call the second report program, and to execute it?
    thanks
    Edited by: ben leen lee on May 14, 2008 3:57 AM

    Hi, 
    clear: d_JOB_COUNT.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            JOBNAME  = d_JOBNAME
          IMPORTING
            JOBCOUNT = d_JOB_COUNT.
        submit ZFI_AGEWISE_PERFORMANCE
        VIA JOB d_JOBNAME
        NUMBER  d_JOB_COUNT
        with IKUNNR   IN r_id
        with s_vertn  in S_VERTN
        with s_hkont  IN S_HKONT
        with IBUDAT   eq IBUDAT
        with P_BUKRS  eq P_BUKRS
        with s_umskz  in s_umskz
    *with R1 = R1
        WITH R2 = R2
    *with r3 = R3
        WITH P_SESS = P_SESS
        AND RETURN.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            JOBNAME      = d_JOBNAME
            JOBCOUNT     = d_JOB_COUNT
            STRTIMMED    = 'X'.
    Reward Points

  • Is it possible to calling another stored procedure in another database?

    Hello all, I hope you can help me out.
    I need to call another stored procedure in another database? Is it possible?
    I know you can call another stored procedure in the same package:
    Var_SQL :='call SP_Tes (''' || Var_1 || ''',''' || Var_2 ||''')' ;
    EXECUTE IMMEDIATE Var_SQL;
    But how do call it if its in another database? I assume, I'd have to open a new connection to it, then call it...
    Please help me. thanks

    I managed to find my synonym;
    select synonym_name, table_owner, table_name from all_synonyms where synonym_name = 'PKG_EDONWEB70'
    (BTW, its upper case sensitive, I eventually found out)
    But as you said; "anyway, what..."
    1)Crete synonym with the dblink, which is the same DB as the one I'm using:chec
    create public synonym pkg_edonweb70test2 for [email protected]
    Result: ok2)check it exists:
    select synonym_name, table_owner, table_name from all_synonyms where synonym_name = 'PKG_EDONWEB70TEST2'
    Result: ok3)check it runs in sql:
    DECLARE
        P_RETURNVALUE1 number;
    BEGIN
        PKG_EDONWEB70TEST2.SP_TESTSMB_DESTINATION ( P_RETURNVALUE1 );   
        COMMIT;
    END;
    Result: ok4)Add it to the strored procedure that is going to call it
    PROCEDURE sp_testSMB_origin(P_RETURNVALUE1 OUT number) IS
            thissql varchar(1000);      
        BEGIN
        BEGIN
            PKG_EDONWEB70TEST2.SP_TESTSMB_DESTINATION ( P_RETURNVALUE1 );   
            COMMIT;
        END;
        end sp_testSMB_origin;
    Result: FAIL; pls-00201: identifier 'PKG_EDONWEB70TEST2' must be declared

  • Call Another DC from one DC.

    Hi,
    I have a scenario where I have an application DC. In that, I have a button which is suppose to call another DC. On click of the button a View in the second DC should appear as a pop-up. How to I go about it?
    Thanks,
    Prasanna

    Hi prasanna
    1) In the  dc1 (popup dc)
    Component controller
    Create a pop up calling method
    //@@begin javadoc:Callpopup()
    /** Declared method. */
    //@@end
    public void Callpopup(  )
    //@@begin Callpopup()
    //popup steps
    //@@end
    2) component interface controller
    Add the usage of component controller of model dc component
    create a method in interface controller for calling the method Callpopup in component controller
    //@@begin javadoc:Interfa_ctl_mthd()
    /** Declared method. */
    //@@end
    public void Interfa_ctl_mthd( )
    //@@begin Interfa_ctl_mthd()
    wdThis.wdGet<modeldc>Controller().Callpopup();
    //@@end
    3) Open the DC Metadata>Public Part>New public part
    Give a name and Select the API and in the Select Entity type, select the web dynpro component and in the select entity which is at the bottom of select entity select the dc1/component (Ie component inside the web dynpro component)
    4) Build and deploy the  dc1
    DC2
    1) Expand the DC metedata > used DC >right click and select add used dc and select the  dc1 and select the build type in dependency tab
    2) Expand the web dynpro component structure and Select the Used web dynpro component and right click and select used webdynpro component and browse the component and give a name ie popupcomp
    3)In the view of project dc define the usage of the component popupcomp
    In any action of button , call the popupcomp comp like this
    //@@begin javadoc:onActionGo(ServerEvent)
    /** Declared validating event handler. */
    //@@end
    public void onActionGo(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionGo(ServerEvent)
    wdThis.wdGetpopupcompInterface().Interfa_ctl_mthd();
    //@@end
    for popup code look at this thread
    Re: How to create pop up window ?
    Hope this helps,
    Regards,
    Arun

  • Calling another java file

    I have a main class ( packet.java for example) and I need to call another file (filter.java) to display a dialog box. Both files are in the same package, but all I want to do is when a button is clicked in packet.java, I want it to display the dialog box in filter.java.

    example:
    you have to source files with one class in each:
    file1:
    public class HelloWorld {
       private String helloText = null;
       public HelloWorld(String text) { // constructor
          helloText = text;
       public String getMessage() {
          return "Hello " + helloText;
    }file2 (which accesses the class in file1):
    public class Foo {
       public static void main(String[] args)  {
          for(int i=0; i<args.length; i++) {
             HelloWorld hello = new HelloWorld(args);
    System.out.println(hello.getMessage());
    if you run the app like this:
    java Foo blackieul Thofthe output will be:
    Hello blackieul
    Hello ThofPlease specify your problem more detailed - e.g. post an exception message or the fragment of code where you don't know what to do...

  • Sp to call another SP if all the latest packages ran successfully

    Hi-
    I have 3 ssis packages, If in the recent execution all the packages ran successfully then another SP has to run. I have created a audit table which keeps the package info. Below is the audit table.
    pkg_name,exe_status,pkg_exe_time
    pkg3,fail,2014-02-01 08:27:12.867
    Pkg1,Succ,2014-02-02 09:26:47.203
    pkg2,succ,2014-02-26 09:27:09.920
    pkg2,fail,2014-02-27 09:41:52.457
    Pkg1,Succ,2014-02-28 09:42:01.750
    pkg3,Succ,2014-02-28 09:42:28.740
    I have to write a stored procedure which will call another SP.
    If the "pkg_exe_time" is the latest time and "exe_status" is "succ" for all the pkg_name(pkg1,pkg2,pkg3) then only it will execute another sp.
    Can any one please help me to write a sp.
    Regards,
    Partha

    wil look like below
    CREATE PROC Proc1
    AS
    IF NOT EXISTS(
    SELECT 1
    FROM (SELECT ROW_NUMBER() OVER (PARTITION BY pkg ORDER BY pkg_exe_time DESC) AS Rn,*
    FROM audittable)t
    WHERE Rn = 1
    AND status = 'fail'
    EXEC Procedure2 ...
    GO
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • In Captivate 7, how can I call another action from within an action?

    I have a conditional action called FakeSuccessRewind. Now I need to call another function called ShowGrayBalloons02 from within its Else statement, but I couldn't find something like "Execute Advanced Action." Can anybody share some tips here? Thanks!
    Below are screenshots of my two actions:
    1) FakeSuccessRewind (if/else). Here I need to call the 2nd action from the Else statement, underneath the statement Go to the next slide.
    2) ShowGrayBalloons02. Note this function has five seperate runs when the variable is decrementing from 5-1.
    Thanks a lot!
    Melissa

    You can't, you need to add the other action into the first one.

  • Button won't work after calling another swf

    Hey!
    I have a scene where multiple buttons appear.
    One of them calls a  different swf file with loadMovie(). The other swf has a button that  uses the same function to return to the original swf (i have created a  swf for every scene of the original fla and so I can return to the exact  scene where I was). Another button in my original scene just calls another scene  of the same swf with gotoAndPlay.
    So far so good.
    The problem is that after I go forth and back to the external swf, using the 1st button, the  other button (that sends the user to another scene) won't work. It just  does nothing.
    (Although every other button in the scene keeps working).
    Using AS2 in CS5 (don't ask why i didn't use AS3 - noob).
    Any ideas?
    Thanks

    Ok, the whole scene has a simple loop to keep it running..
    The first button has:
    on (release)
    loadMovie("game.swf",1);
    The button on the external swf has:
    on (release)]
    stopAllSounds();
    loadMovie("project_games.swf",1);     //I have a swf for the original scene to connect the external swf directly with it, rather the whole project swf
    The other button in my original scene (the one that doesn't work after the use of the above two):
    on (release)
    gotoAndPlay("begin",1);                 //begin is the name of a scene in the project
    That's it.
    THanks for your reply my friend.
    Any ideas?

Maybe you are looking for