How to access variables??

how to access public variables of any other class??
suppose i have a file temp.java file ..& i know all the public variables. and
i want to access the variable of those temp.class file which extends JApplet or Applet..
and as u know it will declare public void init() .. & in this function only all declaration will be there.
so now how to invoke this init() function from any mymethod()..to access public variables...

its not working. for me..
the variable which i m trying to access is non static.. its displays the error :
Exception in thread "AWT-EventQueue-1" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
and by one method i have connected database also.. and it has been called from init()..
i have collected the data from the database..and i m storing the data in one ArrayList ..
and i want to access that ArrayList..

Similar Messages

  • How to access variables from other class

        public boolean inIn(Person p)
            if  (name == p.name && natInsceNo == p.natInsceNo && dateOfBirth == p.dateOfBirth)
                 return true;
            else
                 return false;
        }//returns true if Person with same name/natInsceNo/dateOfBirth as phello,
    here am trying to compare the existing object with another object.
    could you please tell me how to access the variables of other class because i meet this error?
    name cannot be resolved!
    thank you!

    public class Person
        protected String name; 
        protected char gender;      //protected attributes are visible in the subclass
        protected int dateOfBirth;
        protected String address;
        protected String natInsceNo;
        protected String phoneNo;
        protected static int counter;//class variable
    //Constractor Starts, (returns a new object, may set an object's initial state)
    public Person(String nme,String addr, char sex, int howOld, String ins,String phone)
        dateOfBirth = howOld;
        gender = sex;
        name = nme;
        address = addr;
        natInsceNo = ins;
        phoneNo = phone;
        counter++;
    public class Store
        //Declaration of variables
        private Person[] list;
        private int count;
        private int maxSize;
    //constructor starts
        public Store(int max)
             list = new Person[max];//size array with parameters
             maxSize = max;
             count = 0;
        }//end of store
    //constructor ends
    //accessor starts  
        public boolean inIn(Person p)
           return (name == p.name && address == p.address && natInsceNo == p.natInsceNo);
        }//returns true if Person with same name/natInsceNo/dateOfBirth as phope it helps now!

  • How to access variables outside user exit

    Hi,
    I'm working with a user exit and my problem is that in a particular moment I have to access variables located outside the scope of the user exit (they are in a standard program)
    How can I reach these variables?
    thanks in advance

    Hi,
    If they are global variables then you can access them using Global assign technique,
    For example,
    FIELD-SYMBOLS: <fs_value> TYPE ANY.
    ASSIGN ('(SAPMV45A)XVBAK') TO <fs_value>.
    It is basically,
    ASSIGN ('(<Std. Program Name>)<Variable name>') TO <field symbol>.
    NOTE: To make sure they are accessible in your user exit, just put a break-point in the user exit and once you are there in debugging, type in,
    (<Std. Program Name>)<Variable name> in the Field names section and if it does not show it in RED then it is accessible..
    Hope this helps.. 
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • How to Access Variables defined in the PopUpWindow

    Hi Friends
    I am building a flex site using flex builder 2.....
    Here I need your help.....
    My Problem is how to store a variable from a popup window
    I have this problem while in the login window comes as popup
    while clicking login button in the page a popup where user
    can enter username and password...
    after submitting if the login is successufl the popup
    vanish...
    After a successful login I need to store the logged user name
    in the main index page but I am not able to store
    At first I created a variable 'loggedUsername' in the popup
    panel and after success log i assigned the username to it ... after
    it i am not able to get the loggedUsername..
    doubting I defined the variable in the main index.mxml page
    but this variable is not accessible from the loginwidow.mxml page
    where the popup will function...
    Heip me
    how to store the name if the user login is success..
    thanks
    Chintu...

    Lets say you have a public property in your application like
    public var name:String = "John Smith";
    to access this using an inline item renderer:
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox>
    <mx:TextInput text={outerDocument.name} />
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    To access variables of the applicaton you can use
    Application.application.name (for example) to reference "global"
    variables, so you might also use this technique. With an inline
    item renderer, the outerDocument property will refer to the
    component which contains the renderer.

  • How to access variables declared in java class file from jsp

    i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like
    classname object=new classname();
    now iam able to access only the methods defined in the class but not the variables. i have defined connection properties in class file.
    in jsp i need to use
    statement=con.createstatement(); but it shows variable not declared.
    con is declared in java class file.
    how to access the variables?
    thanks

    here is the code
    * testbean.java
    * Created on October 31, 2006, 12:14 PM
    package property;
    import java.beans.*;
    import java.io.Serializable;
    public class testbean extends Object implements Serializable {
    public String sampleProperty="test2";
        public String getSampleProperty() {
            return sampleProperty;
    }jsp file
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <html>
    <head>
    <title>Schedule Details</title>
    </head>
    <jsp:useBean id="ConProp" class="property.testbean"/>
    <body>
    Messge is : <jsp:getProperty name="msg" property="sampleProperty"/>
    <%
      out.println(ConProp.sampleProperty);
    %>
    </body>
    </html>out.println(ConProp.sampleProperty) prints null value.
    is this the right procedure to access bean variables
    thanks

  • How to access variables declared in main mxml in itemrenderer files

    Hi,
    I have a main mxml which has a cutomRenderer that defines two
    mxml components
    namely raidobutton and textinput.
    Now in this TextInput.as i need to access variable defined in
    main mxml.
    Please suggest a way.
    Thanks,
    Lucky

    Lets say you have a public property in your application like
    public var name:String = "John Smith";
    to access this using an inline item renderer:
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox>
    <mx:TextInput text={outerDocument.name} />
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    To access variables of the applicaton you can use
    Application.application.name (for example) to reference "global"
    variables, so you might also use this technique. With an inline
    item renderer, the outerDocument property will refer to the
    component which contains the renderer.

  • How to access variables across JSP and JavaScript?

    Hi,
    I have some .js files and in those files, some of the methods need to access to the variables that I'd declare in the jsp files. How do I do it?
    Anne

    You can do it this way, but I'm not sure if this is what you had in mind.
    Say you had a java variable called XString. And you wanted to display
    the value of XString in a javascript Alert. Here's how:
    <html>
    <body>
    <% String XString = "Hi There!"; %>
    </body>
    <script language="javascript">
    alert("<%=XString%>");
    </html>Hope This Help,
    P.

  • How to access variables passed in custom tag body

    I am developing custom tags in my application. I need to pass some variables from the .jsp file into tag file. I want these to be passed as body of the tag rather than as tag parameter. It seems the correct syntax for this is:
    <myTags:display> someVariable </myTags:display>
    Question 1: Can I not use this as: <myTags:display someVariable /> Since this tag will be used at many places in the jsp, I dont want to write myTags:display twice for every usage.
    Question 2:
    I want to call the tags from main.jsp like:
    <% String var1 = "Display Me Please"; %>
    <myTags:display var1 />I want the tag file to do some processing on the value stored in var1. I've written the following code in tag file, display.tag:
    <jsp:doBody var="theBody" />
    <% Object obj = (Object) request.getAttribute ("theBody"); %>This code snippet gives me access to obj which has the value "var1". Now how do I access the value that is contained in "var1".
    Edited by: coolkomal on Jun 3, 2009 7:45 AM

    coolkomal wrote:
    I am developing custom tags in my application. I need to pass some variables from the .jsp file into tag file. I want these to be passed as body of the tag rather than as tag parameter. It seems the correct syntax for this is:
    <myTags:display> someVariable </myTags:display>
    Question 1: Can I not use this as: <myTags:display someVariable /> Since this tag will be used at many places in the jsp, I dont want to write myTags:display twice for every usage.
    <myTags:display var="<%=someVariable>"/> is a valid syntax for performing respective action of that variable. You can also use EL to pass the variable ${someVariable} provided the custom tag provide support for EL.
    >
    Question 2:
    I want to call the tags from main.jsp like:
    <% String var1 = "Display Me Please"; %>
    <myTags:display var1 />
    Just ensure that you declare all the related variables in Main.jsp and statically include Main.jsp in your jsp such that you do the checking
    [http://java.sun.com/products/jsp/tags/11/syntaxref117.html]
    >
    I want the tag file to do some processing on the value stored in var1. I've written the following code in tag file, display.tag:
    <jsp:doBody var="theBody" />
    <% Object obj = (Object) request.getAttribute ("theBody"); %>This code snippet gives me access to obj which has the value "var1". Now how do I access the value that is contained in "var1".Can be done provided you code it the right way. Start learning basics of how to create custom taglibraries to gain more knowledge on how things can be managed.
    [http://java.sun.com/javaee/5/docs/tutorial/doc/bnalj.html]

  • How to access variables in windows

    Hi,
    I am new on windows platform. I did work on linux.
    on linux we makes 2 entries in bash_Profile as ORA_dbENV and ORA_appsENV to set the variables which can be accessed using
    linux> . $ORA_dbENV
    linux> cd $ORACLE_HOME\appsutil\scripts\PROD_ltm
    linux PROD_ltm> ./adautocfg.sh
    how can we do this on windows?
    do we have to navigate to the directory manaully like
    cmd> cd d:\oracle\PROD\db\tech_st\10.2.0\appsutil\scripts\PROD_ltm
    d:\oracle\PROD\db\tech_st\10.2.0\appsutil\scripts\PROD_ltm>adautocfg.cmd

    Hi,
    how can we do this on windows?
    do we have to navigate to the directory manaully like
    cmd> cd d:\oracle\PROD\db\tech_st\10.2.0\appsutil\scripts\PROD_ltm
    d:\oracle\PROD\db\tech_st\10.2.0\appsutil\scripts\PROD_ltm>adautocfg.cmdYou will have to source the application/database env file (.cmd) manually before running AutoConfig script, then run adautocfg.cmd script as you have mentioned above.
    Regards,
    Hussein

  • How to access variables in webservice

    Hai,
    I am using SAP Netweaver Developer Studio. I want to handle the error codes by using a variable in the session bean. but i am not able to access the variable . please help me asap.

    ok, the answer is here
    http://blog.flexexamples.com/2008/08/28/creating-a-component-instance-by-class-name-in-act ionscript-30/

  • How to access variables in dynamically created custom components? (Flex 4.5)

    Hi i have another riddle here.
    i have few custom MXML components in my library and i am adding them to the stage by script, after that i want to fill some data, lets say Label.text, inside this component.
    The question is how to acces / reference variables or other components inside the main custom component which was added to the stage by script???
    thx M.

    ok, the answer is here
    http://blog.flexexamples.com/2008/08/28/creating-a-component-instance-by-class-name-in-act ionscript-30/

  • How to access variables indirectly using JSTL

    Hi,
    I have a variable called titleInsert pointing to a session variable someSessionVariable. The jsp has access to titleInsert but would like to output the value of someSessionVariable which is pointed to by tilesInsert.
    If I have something like
    <c:out value="${titleInsert}"/>
    the name of the session variable is being displayed but not the value.
    I tried something like
    <c:out value="$${titleInsert}"/> and
    <c:out value="${${titleInsert}}"/> and both resulted in JSP exceptions.
    Is there a way to display the value of someSessionVariable?
    Help appreicated,
    Kumar

    You use the implicit variable sessionScope, and the square brackets notation.
    <c:out value="${sessionScope[titleInsert]}"/>Cheers,
    evnafets

  • How To Access Variables In Process Model For Use In Main Sequence

    Hi everyone, in my sequence file I callback the PreUUT sequence file.  I want to be able to use one of the local variables I assign in this callback sequence in my main sequence.  In my main sequence this variable will trigger if I should run some tests or not in my main sequence.  Is this possible?  How would I do this?
    Thanks so much!

    U need to make a parameter in your Callback, parameters are seen outside of sequences, then in PreUUT u will make statement to update parameter, or use the parameter in your callback  directly
    Parameters.MyPara=Locals.MyLoc
    etc

  • How to access variable values across mappings?

    Hi all,
    I have created the following sample class Test.java and imported it as an archive:
    public class Test{
    public static String myStringData = null;
    In one of the mappings, I have a UDF that sets the  "myStringData" using the foll:
    Test.myStringData = "Amit";
    I am trying to access this variable in another mapping using a UDF with foll statements:
    String test = Test.myStringData;
    result.addValue(test);
    However, on testing the second mapping I get the value of the variable as null. I have activated all objects.
    Not sure what exactly I am missing here...Kindly provide your inputs.
    Thanks..
    Amit

    Hi,
    >>>Shabarish/Praveen, it would be great if you could provide me with some examples on the suggested approaches as I am relatively new to PI.
    the truth is that you should not write anything from message mappings
    as:
    what happens if the DB table to which you want to write will be locked
    what happens if the file will not be accessible ?
    it's better not to write anything from message mappings
    especiall if you say you're new to XI
    maybe just tell us the real problem - why do you think you need to do it?
    Regards,
    Michal Krawczyk

  • How to access variable number of columns using ref cursor !

    Hi,
    I am trying to get variable number of columns using ref cursor.
    Declare
    mySzSql varchar2(2000);
    Type dynSqlRC is Ref cursor;
    current_cur dynSqlRC;
    tbl_rec alt_42_consolidated%Rowtype;
    Begin:
    /* This works */
    mySzSql := 'select *
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    /* i want something like this to work, this is not working, giving missing variable name error */
    mySzSql := 'select col1, col2, col3
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    open current_cur for mySzSql;
    fetch current_cur into tbl_rec;
    close current_cur;
    End;
    I do have the list of desired columns which I am looking to fetch, so after taking that in the record type, how should i get their values. Is it possible to traverse tbl_rec declared above and if column name matches then I will store the value in the array and finally return this array.
    Can somebody please tell me how to do this.
    Thanks

    It appears that this is a followup to How to loop through columns selected by select clause which is itself a followup to [url="
    How to execute dynamic sql"]this earlier thread.
    Assuming these are intended to be followup questions, can we please stick to a single thread? That makes it a lot easier to understand the situation and follow the conversation. Starting multiple threads makes it harder to follow the conversation.
    Thanks,
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • Moving from Exchange 2007 to 2013 (leaving the DNS Server for it's own dedicated server)

    Hello! I am quite new to Exchange and Server management in general. I will do my best to explain my situation. I am looking to move my Exchange server off of our DNS server. When we installed them on the same server, we did not have the funds to buy

  • What does Mac or apple use for microsoft word and excel?

    What do I need to buy or download to get Microsoft word and excel and PowerPoint ?

  • PO Price in 'JPY' Currency.

    Hi Everybody ,   I have the problem in 'JPY' Currency , I print PO Price in 'JPY'  on po form but this price removed decimal places. eq.  Po Price is 100. but Po Form Print 1. What is that problem?    I want Print PO Price 100. How I print this price

  • External CSS styles not working in Flash

    I have a text area component and it loads external text files into the area. Works great. Now my client needs to have some simple tabular data in there .. 3 columns by 3 rows, one value per cell. But Flash doesn't support table tags in html formattin

  • MS Word -  OS 9 Classic?

    Last week I downloaded a MS Office update. Now when my daughter signs on to Word it is looking for OS 9 ? The other 3 sign-ons on the computer boot Word normally in OS 10.4.11 How do I get it to revert back?