I want to call a variable in another application

Greetings,
I asked previously a similar question but I didn't got a solution to my problem, so i'll explain in details my problem:
I have a Java File called Senior.java, and another one called Properties.java
Properties.java is a dialog box that I can open from the main application Senior.java using Tools > Properties command.
Now, in Properties I have Radio buttons, and In Senior I have a JButton that upon clicking should run a process depending on what I choose in the properties dialog box.
One solution I thought about is to retun a number for every Radio Button and store this number in an integer variable "action".
Now I want from Senior to know the value of action.
Some code from properties.java:
public class Properties extends JFrame
private int action;
   public Properties()
   { // Creating the Radio Buttons and set visible ............................         
   public static void main( String args[] )
      Properties application = new Properties();
      application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    private class RadioButtonHandler implements ItemListener
        public void itemStateChanged( ItemEvent event )
            if (event.getSource()==adfButton)
                action = 1;
            else if ( event.getSource()== normalButton )
                action = 2;
            else if ( event.getSource()== hiddenButton )
                action = 3;
/*     public int getAction()
        return action;
Any Suggesstions
Thanks in Advanced
M.Tleis                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

sorry, the previous compilation error is due to a mistake I did in my code.
the actual problem is, when I change private to public, the main class of Properties.java will be executed, for this reason when I click the JButton in my main software ( Senior.java ) the properties dialog box will appear. while I only need the value of the varialbe action, without running the whole Properties.java

Similar Messages

  • Accessing another variable from another application

    I was wonder how I can access another variable form another application?
    For example: I want to access :P4_EMPLOYEE_NAME from app ID 104 when I am doing is from an activity in page 2 on app ID 142.
    I had a search before, but I am looking for an unambiguous response.

    Greg - About all you can do is call the function htmldb_util.fetch_app_item(p_item => 'F104_ITEM', p_app => '104'). The application you call this function in must be sharing a session with the application from which you are fetching the item, both applications must belong to the same workspace, and the item you name in the argument must be defined as an application-level item in the fetched-from application.
    Scott

  • How can I call a variable from another class

    hi
    If I have two classes : one and two
    In class two I have a variable called : action
    In class one I want to check what is the value of action.
    How can I call action?

    Thank you scorbett
    what you told me worked fine, but my problem is that MyClass2 is an application by itself that I don't want to be executed.
    Creating myClass2 as in the following:
    MyClass2 myClass2 = new MyClass2();
    [/code]
    executes myClass2.
    Can I prevent the exectuion of MyClass2, or is there another way to call the variable (action)?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to call a variable from another class?

    Greetings
    I�m designing a program that is called Senior.java, and I want to design it�s menus, for simplicity in reading the code, I want to write a separate java file for each menu. For example I want a file.java, edit.java etc�.
    Since I�m not a professional I�m having problems in calling the variable �bar�, that I created in senior.java,
    In Senior.java I have :
    JMenuBar bar = new JMenuBar();
    setJMenuBar( bar );
    In fileMenu.java I want to add file menu to the menu bar �bar�:
    bar.add( fileMenu );
    When I compile the fileMenu.java I got a �cannot resolve symbol � message, where symbol is the variable bar.
    Can you please help me, knowing that i'm using SDK1.4.1?

    Sun has recommendations for naming conventions. Class names should start with a capital letter. You should avoid using class names that are the same as classes provided in the SDK. Following these conventions will make it easier for people to help you. For example, you should not use file, nor should you use File. It's better to use MyFile, replacing My with something that makes sense to your application (SeniorFile?).
    Also, check the Formatting Help link when posting for a desciption on how to use the code tags for posting code.
    1. You need to establish references between your classes. One way is to have a constructor that has a JMenuBar argument.
    2. You can not add a file to a JMenuBar because a JMenuBar adds a JMenu. I don't think you want file to extend JMenu. It may be better for file to have a JMenu.
    I haven't tried to compile this code so no guarantees - just trying to show you an approach.
    public class Senior extends JFrame {
       public Senior() {
          JMenuBar bar = new JMenuBar();
          MyFile file = new MyFile(bar);
    //whatever else you need
    public class MyFile {
       public MyFile(JMenuBar mbar) {
          JMenu menu = new JMenu();
          mbar.add(menu);

  • How to call Oracle form .from another application like VB 6.0

    Dear ALL,
    I want to call oracle(Developer) form ,from another application (VB 6.0).I want to call the form in such
    a way that user dont need to enter login and password.I will hard code the username and password
    in my VB 6.0 application.User only press a button on Visual Basic 6.0 form and and that button will
    open required Orcale form.How can I DO this.PLEASE HELP............
    Regards

    You have the command in VB 6.0 to run any exe files right (I think it is the system command). Next to that command place the following code to run your forms application
    ifrun60.EXE <forms.fmx with complete path> userid=<username>/<password>@<connection string>.
    Regards,
    Senthil .A. Perumal.

  • How to call a variable in another class????

    if i have two classes in a package. From one class, how do i get the value of one of the variable in the other class.
    For example;
    Class A have a variable call totalNum which have a value initialise.
    Class B wan to get the value variable totalNum in class A.
    So do i go abt calling it?
    Cheers

    For example;
    Class A have a variable call totalNum which have a
    value initialise.
    Class B wan to get the value variable totalNum in
    class A.Your explanation is far from clear. Is the variable in class A a field? If yes, is it a static field? Is it declared public, private, etc.?
    If you don't understand the above questions, you should do the following:
    1) Learn the basics of the Java language from the Java Tutorial and/or from an entry-level book: http://java.sun.com/docs/books/tutorial/
    2) Post future question in the New To Java Technology forum.

  • Passing values to session variables from another application

    Hi,
    From an external application we are passing username and password for accessing the OBIEE Dashboard.In the url call we are passing NQUser and NQPassword. This is working fine.
    To setup data level security we need to pass region id list also as request object. Then we can filter the tables by the value in the region id list for that user. If we use external table to pass the home_id list then the application is working fine by setting up row-wise init block. But we need request object from an external application to send the list. How can we accept the list from OBIEE RPD?
    In the documentation it mentions about session variables - non system. But it requires an init block. How can we create a variable that accepts the values when user logins just like NQUser and NQPassword.
    Please suggest.
    Thanks.

    Try this ...
    http://oraclebizint.wordpress.com/2007/07/30/customizing-obi-ee-%E2%80%93-go-url-parameters/
    In this blog entry you'll find at the bottom ...
    Hello, Can you please explain how to pass parameter values in the url. For example, I want to run an answers query and pass into the url something like this: &Region=West
    Venkatakrishnan J Says:
    August 22, 2007 at 7:36 am
    Yes, this absolutely possible. You can get the details from the Web Services guide since it has all the necessary examples and more explanation. Thats why i did not include it in the blog. You can get it from page 213 of the Docs http://download.oracle.com/docs/cd/B40078_02/doc/bi.1013/b31766.pdf

  • How to share one application's static variable in another application?

    Hi,
              How to share one string value across two applications, which are there in two different JVMs.
              Requirement is, If I update one value(static) in first server through jsp, it should update second server static value too apart from first server.
              I am using WebLogic 8.1, is there any MBean to access other application's static value?
              Please suggest!
              Thanks,
              Murthy P

    I'd need more information to recommend an appropriate approach.
              How often do you access this value? Can you make a remote call to retrieve it each time, or would that overhead be unacceptable? How are you handling HA? (ie what happens when a server fails). How often do these values change, and what is your tolerance for stale data?
              -- Rob
              WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Calling instance variable...

    Hi,
    Just wondeirng if I defined some instance variables in a class. If I want to call the variables in another class. Is it like <class_of_variables_are_defined>.<variables> ?

    Here are the codes I have written...I am still having a little trouble though
    Variables that I have defined in two different class...
    Ride.class
    public class Ride
         private String name;
         private int ticketsRequired, numberOfRiders;
         private float heightRequirement;
         public String getName()
              return name;
         public int getTicketsRequired()
              return ticketsRequired;
         public int getNumberOfRiders()
              return numberOfRiders;
         public float getHeightRequirement()
              return heightRequirement;
    TicketBooth.class
    public class TicketBooth
         private float moneyMade;
         private int availablePasses;
         public float TICKET_PRICE = 0.5f;
         public float PASS_PRICE = 16.5f;
         public float getMoneyMade()
              return moneyMade;
         public int getAvailablePasses()
              return availablePasses;
         public TicketBooth(int initAvailablePasses)
              availablePasses = initAvailablePasses;
                         .....Now when I try to use those private instance variables in Person.class, I got bunch of errors. I know private instances can only be used within the class they defined. How should I correct the code below?
    Person.class
                         public boolean buyPass(TicketBooth booth)
              if (hasPass == true && money >=  PASS_PRICE)
                   return true;
              else
                   return false;
         public boolean allowedToRide(Ride aRide)
              if (height >= heightRequirement &&
                 (hasPass == true || ticketCount >= ticketRequired))
                   return true;
              else
                   return false;
         public void getOn(Ride aRide)
              if ((allowedToRide(aRide) == true) && (hasPass == true))
                   availablePasses -= 1;
                   numberOfRiders += 1;
              else if(ticketCount >= ticketRequired)
                   numberOfRiders += 1;
                   ticketCount -= ticketsRequired;
                         .......

  • Bex exit Variable from another one.

    Hi Expert,
    Do you Know how to define a value for a variable from another that is navigable in the bex query. In other words, when i change a value during the OLAP navigation in the query, another variable must change on the basis of the first one. The first variable isn't a "variable selected from user" on the start of the query but is a "mandatory" with a default value. When the default is changed on the OLAP,  another variable must change.
    How can I do?
    Thanks.

    OK. I see - just to be sure: You dont want to call the variable screen, when making the change, right? That is how I understand it, if I am wrong, you can use an exit variable for ZC_FASCIA and fill it depending on what was set in 0calmonth variable.
    So, assuming you dont want to call the variable screen, have you tried setting the dependent variable to changeable during query navigation? I dont think it works, but anyway, try it out...
    One way of "solving" your requirement of "set value for Y when X is changed by user" could be to use a compounded characteristic where you compound ZC_FASCIA with 0calmonth. I think you should be able to compound ZC_FASCIA = 1 with 0calmonth = <blank>...
    Next, create a variable for this new char. Using a default should be possible and it would have to be changeable during query navigation and let users change the default month without calling the variable screen.
    I dont know if this works/helps...
    Regards
    Jacob
    P.S: Your requirement only seems to come from the "need" to have 0calmonth = #. If you did not need the #, you would always have 2 for ZC_FISCIA... so I was wondering why you need the blank month? Something with an annual value stored in # month??
    Edited by: Jacob Jansen on Jan 29, 2010 9:38 PM

  • Want to call and run a vi that is not in memory

    I have a vi  (say Sub1.vi) that I want to call and run from another vi (Say Main.vi). Sub1.vi is not loaded into memory, when Main.vi is started. From within Main.vi I want to load Sub1.vi and run it. But I don want Main.vi to wait for completion of sub1.vi - sub1.vi needs to run continuously in the background.
    So I tried calling the sub1.vi using the Open vi Reference and the Invoke Node to run the vi. This works only if Sub1.vi is already loaded in memory.
    Next I tried Open vi Reference, Invoke Node to Open FP and then another Invoke Node to Run the vi. This works when the sub1.vi is not loaded in memory but it opens the FP of sub1.vi.
    But I dont want the FP to open and be displayed - I want sub1.vi to run in the background.
    How do I achieve that?

    Hi,
          You've probably figured this out by now; if not, maybe this will help!
    Message Edited by tbd on 07-12-2006 11:07 PM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
    Attachments:
    Main.vi ‏17 KB
    SubVI.vi ‏8 KB

  • Calling a variable by 2 names

    Some times I want to call a variable by an indexed name.
    for (int i= 0; i <5; i++)
    array[i] = from;
    from[0] contains the number of names
    from[1] contains the number o people
    from[2] contains the number of dogs
    from[3] contains the number of cats
    from[4] contains the number of birds
    In other parts of the program, to make it more understandable, I want to refer to numOfBirds rather than from[4]. countOfBirdies = numOfBirdsIs there a way to set up the name equivalence in Java?
    Thank you                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    zscipio wrote:
    I am interested is satisfying both concepts as it is possible in some other languages. One simple way is to introduce named indexes, like
    public class NumberOf {
       private NumberOf(){} // private constructor to prevent instantiation
       public static final int NAMES = 0;
       public static final int PEOPLE = 1;
       public static final int DOGS = 2;
       public static final int CATS = 3;
       public static final int BIRDS = 4
       public static final int SIZE = 5; // number of constants
    }Now you can do,
    for (int i= 0; i <NumberOf.SIZE; i++) {
       array[i] = from;
    countOfBirdies = array[NumberOf.BIRDS];It's probably not exactly what you wanted but at least you're using symbolic names rather than naked indexes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need help passing variables to another jsp page

    I am working in a shopping cart with multiple lines and I am wanting to pass 2 variables to another page which is accessed from a link.
    What I have so far is the following:
    This is on the shopping cart JSP page with the link
    <input type="hidden" name="shopCartReqDate1<%=i%>" id="shopCartReqDate1<%=i%>" value="<%= retVals[9] %>">
    <input type="hidden" name="shopCartExpDate1<%=i%>" id="shopCartExpDate1<%=i%>" value="<%= retVals[10] %>">
    Need it Earlier?
    I am wanting to pass it to the HAC_Help_Text_Need_it_Earlier.jsp page
    Right now on the HAC_Help_Text_Need_it_Earlier.jsp page I have the following code:
    String shopCartReqDate1 = IBEUtil.nonNull(request.getParameter("shopCartReqDate1"));
    String shopCartExpDate1 = IBEUtil.nonNull(request.getParameter("shopCartExpDate1"));
    Do I need to create a function and do a document.getElementById?
    Thanks for the help!

    As far as I understand your question You don't have to use document.getElementById. Just submit the form and then on the next page You'll just pull the variables out from the request object.

  • Call a ABAP Web-Dynpro-application via a BSP-Application

    We have a BSP-Framework, that call several applications among other things other BSP-Applications, ITS-Application and other systems. Now I want to integrate a ABAP Web Dynpro-Application.
    For the moment I can call the ABAP Web Dynpro-Application from our application.
    This application runs in the same session as the Framework (verify in transaction sm04).
    When I want to call another application in the Framework, the session will be killed (no more sessions in sm04). This happens also, when I want to call the ABAP Web Dynpro-Application a second time.
    I guess, that the ABAP-Framework thinks I want to go outside the system (for example www.google.de) and close the session. I found out, that this wouldn't happen, if the application were suspended. But I found no way to tell the application via a url-parameter to suspend.
    Can someone help me?

    Thx for the tip,
    but I can't firea suspend plug. Because I'm in BSP. I understand the docu so, that you have the option to call a other apllication like BSP from a ABAP Web Dynpro.
    I want to call the ABAP Web Dynpro form BSP like this way.
    1. Start BSP-Framework
    2. Call ABAP Web-Dynpro-Application from BSP
    3. Call another Application from BSP without automatically logout by unload ABAP Web Dynpro. (I have a chance to call the ABAP Web Dynpro again via url to suspend before I call the other app.)
    Regards Stefanie

  • Lookup ejb in another application in same container

    Hi,
    The 1012 ejb faq http://www.oracle.com/technology/tech/java/oc4j/1012/collateral/OC4J-EJB-FAQ-101202.pdf states:
    "If you want to access an EJB in another application in the same OC4J container you do not have to use RMIInitialContextFactory and you can make the application that contains your application as the parent of your application from your you are trying to access EJBs from e.g. ..."
    Question: The FAQ implies that the "parent" attribute is NOT necessary to facilitate this situation and RMIInitialContextFactory may be used - is this correct? I have not found any examples that demonstrate how to do this as elsewhere in the Oracle doco they seem to imply that "parent" must be used (but not in 10.1.3). Can anyone please clarify this and/or what works and what doesn't?
    Note: The lookup of remote ejb from another application in same container does work without the parent attribute, its just subsequent calls from a 3rd application or redeploy breaks.
    My problem: I get a ClassCastException when :
    a) lookup remote EJB (in application A) following redeploy of application B
    b) the next invocation of the application A method from client application C
    Thanks for any advice,
    Paul

    Your understanding is correct.
    If you make application a to be the parent application of app b; then app b could access app a without using RMIInitialContext.
    Also you could use RMIInitialContext to obtain the object without using "parent application" approach, example:
    Hashtable env = new Hashtable();
    env.put("java.naming.factory.initial",
    "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put("java.naming.provider.url","ormi://remotehost/bmpapp");
    env.put("java.naming.security.principal","SCOTT");
    env.put("java.naming.security.credentials","TIGER");
    Context context = new InitialContext(env);
    Object homeObject =
    context.lookup("java:comp/env/EmployeeBean");
    For this servlet example, you also need to declare <ejb-ref> elements in the web.xml file:
    <ejb-ref>
    <ejb-ref-name>EmployeeBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>bmpapp.EmployeeHome</home>
    <remote>bmpapp.Employee</remote>
    </ejb-ref>
    In addition, orion-web.xml, must include a mapping from the logical name EmployeeBean to the actual JNDI name where the EJB is bound, as shown in the following example:
    <ejb-ref-mapping name="EmployeeBean" location="bmpapp/EmployeeBean" />
    Hope this helps,
    -Frances

Maybe you are looking for

  • Launching a Discoverer report from jsp page

    Hi I have a discoverer workbook created using BI Discoverer (for relational). I want to accept some parameters for this workbook from a jsp page, which will also have a "View report" button. This button when pressed should open up the Discoverer work

  • Inventory Management 0IC_C03 customizations

    Dear Experts, I have a task in hand to implement Inventory Management in SAP BW 3.5. Now, this is the first time that we will be implementing anything related to Logistics and I havenu2019t done so earlier in my support projects. I have got 10 hrs of

  • How do I reset Business Catalyst log-on after redirecting website to Google Sites?

    I am trying to log into my Business Catalyst account after moving my website to google sites - the BC login tries to go to the new website instead of logging into a business Catalyst dashboard. All I want to do is to make sure the Business Catalyst a

  • Newbie trying to get tracks to mp3 without clipping

    Hi Folks, I have imported a bunch of track from a HDD recorder (as wav files) into Garageband. It's a rock band setup - drums, bass, guitar etc. I can't get the drums or bass anywhere near loud enough without clipping. If you look at the wave form of

  • Files grayed out when "saving as"

    Hello everybody, I've moved from windows to mac recently and i'm doing my best to understand the way this OS works. There are some things that really do not make sense to me as a beginner. Anyways my problem is that when i want to "save as" a file ev