Passing values and calling other classes?

Hello all.
I have 2 classes(separate .java files). One is a login class and the other is the actual program. Login class(eventually exe file) should open the other class and pass the login parameters if you know what I mean. Is this possible, or do the 2 classes need to be part of one file?
Thanks alot
Milan D

Login class can be another class in another file
wht u have to do is to make an instance of login class in the class u want to use that class
like login lg = new Login();
and call method of login class
lg.setUser(username);
where setUser(String user); is a method of login class
this way u can pass the parameters to login class
i hope this might be helpful
regards
Moazzam

Similar Messages

  • Passing values and calling PL/SQL process via a column link

    Hello all
    I have a report and a link on one of the columns which takes you to another page and passes data from the report to that page. That all works fine. In addition to picking up the details from the report I'd also like the link to call a page process before it goes to the next page using some of the values picked up from the report. This I can get to work by changing the link to a URL and putting in some javascript ie javascript:doSubmit('TEST_PROCESS'); By doing this I "lose" the ability to pass the info from the report via the link.
    Can anyone give me a clue as to how I can achieve both please? I'm assuming I'll need to create my own javascript function but I don't know how to pick up information from a row in a report to pass on.
    Regards
    Helen

    Lets say your link would pass 2 items P1_ITEM and P1_ITEM2 to your process. Just write a quick javascript function to do this and put it in the header:
    <script type="text/javascript">
    function doSomething(pValue1,pValue2){
      $s('P1_ITEM',pValue1);
      $s('P1_ITEM2',pValue2);
      doSubmit('TEST_PROCESS');
    </script>This will set 2 hidden items equal to whatever you pass in. Then you can use these in your after-submit process. To call this from your url, just make the url:
    javascript:doSomething(#COL1#,#COL2#);#COL1# and 2 being your report columns. This should do what you need i think

  • How do we pass values and Internal tables to Sub-routines

    how do we pass values and Internal tables to Sub-routines

    Hi,
    You can use the USING..or TABLES..or Changing addition..
    Check this example.
    DATA: T_MARA TYPE STANDARD TABLE OF MARA.
    PERFORM DISPLAY USING T_MARA.
    FORM DISPLAY USING LT_MARA LIKE T_MARA.
    DATA: WA TYPE MARA.
    LOOP AT LT_MARA INTO WA.
      WRITE: / WA-MATNR.
    ENDLOOP.
    ENDFORM.
    Thanks
    Naren

  • Compile and call the class during the runtime

    Hi guys,
    I am struggling with a project, which allow user to modify the behavior of the program.
    To do this, my Java code must be able to compile the Java code (*.java) and call the class from the code during the runtime.
    Here are my code:
    com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();
    String[] options = new String[] {"d:\\javaExternal\\RunTimeCompilation.java"};
    System.out.println(Main.compile(options));This allows me to compile the .java file into .class file. However, I can't find the way to access/use the .class file.
    Do you guys have solution for this?
    Thanks a lot.

    You will also need to investigate class unloading and proxies since presumably they can modify the file and compile it again.
    Might note that in general this seldom works for business solutions. It seems like allowing the users to add their own functionality would be a good idea so the programmers don't have to keep doing it. But the reality is that then the users must become programmers. And often must be pretty good at it as well since they must not only know the programming language but also the framework too. The second problem is that it also becomes a maintenance nightmare for the real developers to upgrade the existing system.

  • How to pass a value and call SE38 program using SUBMIT statement

    Hello Friends
    I am trying to write a batch program in SE38, that calls other SE38 Programs.
    I don't want to use Parameter command to see the value on screen.
    All I want is to send a range of date (ToDate & FromDate) and generate different reports satisfying this date range condition.
    Can some one please help me with this. I would really appreciate it.
    I have tried the command SUBMIT with options of filling the input fields of the subsequent programs but I don't want to do this.
    I want all the sub programs to be called one after another and the reports generated using the date varialbles I send from the main program.
    I don't want to use se37 functions because of the client's request.
    Any help will be highly appreciated.
    Tks
    Ram

    Yes I am using SUBMIT command but I was not using the right options with the SUBMIT command and once I used the right options, it worked.
    Tks
    Ram

  • Putting code to my Jsf and Jsff pages and calling Java class

    I want guidance on how to write simple code on adf pages
    1. I have adf pages (.jsf and .jsff) where I have input text fields and command buttons, I want to put custom code on the command button such that when you click on any of the buttons at runtime, the code will be executed.
    2. In my application, I have a java class which I have written, I need to click on any of the buttons at runtime, the application will call the java class and execute the class. Essentially, taking parameters from my adf page(s) (.jsf and .jsff) to the java class and also returning parameters after execution.

    The version of my Jdev. is 11.1.2.3.0
    Which docs?.... I will be grateful if you can point to the particular doc fro me.
    1) Can you pls tell me in one of few sentences how to add method and set the actionListener property.
    2) in question number 2, I am totally lost... Let me explain my self again to clarify the situation. In my adf page, I have a button and three input texts,my purpose is that at runtime, when a user click on the button, the values in the first two input texts will be passed to the java class as parameters, it is expected to use these parameters to process some form of calculations and return a value which I will place on the  third input field.

  • EJB 3.1 @Asynchronous and calling other methods from within

    Hey all,
    I am helping a friend set up a test framework, and I've turned him on to using JEE6 for the task. I am decently familiar with entity beans, session beans, and such. One of the new features is @Asynchronous, allowing a method to be ran on a separate thread. The test framework generally needs to spawn potentially 1000's of threads to simulate multiple users at once. Originally I was doing this using the Executor classes, but I've since learned that for some reason, spawning your own threads within a JEE container is "not allowed" or bad to do. I honestly don't quite know why this is.. from what I've read the main concern is that the container maintains threads and your own threads could mess up the container somehow. I can only guess that this might be possible if your threads use the container services in some way.. but if anyone could enlighten me on the details as to why this is bad, that would be great.
    None the less, EJB 3.1 adds the async capability and I am now looking to use this. From my servlet I use @EJB to access the session bean, and call an async method. My servlet returns right away as it should. From the async method I do some work and using an entity bean store results, so I don't need to return a Future object. In fact, my ejb then makes an HttpClient call to another servlet to notify it that the result is ready.
    My main question though, is if it's ok to call other methods from the async method that are not declared @Asynchronous. I presume it is ok, as the @Asynchronous just enables the container to spawn a thread to execute that method in. But I can't dig up any limitations on the code within an async method.. whether or not it has restrictions on the container services, is there anything wrong with using HttpClient to make a request from the method.. and making calls to helper methods within the bean that are not async.
    Thanks.

    851827 wrote:
    Hey all,.. from what I've read the main concern is that the container maintains threads and your own threads could mess up the container somehow. I can only guess that this might be possible if your threads use the container services in some way.. but if anyone could enlighten me on the details as to why this is bad, that would be great.
    Yes since the EE spec delegated thread management to conatiners, the container might assume that some info is available in the thread context that you may not have made available to your threads.
    Also threading is a technical implementation detail and the drive with the EE spec is that you should concentrate on business requirements and let the container do the plumbing part.
    If you were managing your own threads spawned from EJBs, you'd have to be managing your EJBs' lifecycle as well. This would just add to more plumbing code by the developer and typically requires writting platform specific routines which the containers already do anyway.
    >
    None the less, EJB 3.1 adds the async capability and I am now looking to use this. From my servlet I use @EJB to access the session bean, and call an async method. My servlet returns right away as it should. From the async method I do some work and using an entity bean store results, so I don't need to return a Future object. In fact, my ejb then makes an HttpClient call to another servlet to notify it that the result is ready.
    My main question though, is if it's ok to call other methods from the async method that are not declared @Asynchronous. I presume it is ok, as the @Asynchronous just enables the container to spawn a thread to execute that method in. But I can't dig up any limitations on the code within an async method.. whether or not it has restrictions on the container services, is there anything wrong with using HttpClient to make a request from the method.. and making calls to helper methods within the bean that are not async.
    Thanks.If you want to be asynchronous without caring about a return value then just use MDBs.
    The async methods have no restrictions on container services and there is nothing wrong with calling other non async methods. Once the async method is reached those annotations don't matter anyway (unless if you call thhose methods from a new reference of the EJB that you look up) as they only make sense in a client context.
    Why do you need to make the call to the servlet from the EJB? Makes it difficult to know who is the client here. Better use the Future objects and let the initial caller delegate to the other client components as needed.

  • Confusion about call-by -value and call - by reference

    class A{
    public boolean check(String source, ArrayList arr){
    //pROCESS ON ARRAYLIST
    class B {
    A con = new A();
    String source="this is string ";
    ArrayList arr = new ArrayList();
    // suppose Arraylist has some elements
    boolean  error= false;
    error = A.check(source,arr);
    }Is it call by value or call by ref .
    Please help
    }

    Object references are also passed by value. ???Yes, as demonstrated byclass Foo {
        public int bar = 0;
        public static void main(String[] args) {
                Foo foo = new Foo();
                foo.bar = 1;
                System.out.println(foo.bar);
                baz(foo);
                // if this was pass by reference the following line would print 3
                // but it doesn't, it prints 2
                System.out.println(foo.bar);
        private static void baz(Foo foo) {
            foo.bar = 2;
            foo = new Foo();
            foo.bar = 3;
    }

  • Calling other classes

    First off, I should note that I'm new here, and this question is probably ridiculously easy to fix, but I'll give it anyway.
    I am making a game (Mini Golf) using the FANG engine (http://www.fangengine.org). I'm not sure if that matters for this problem, but it may. Anyway, the game consists of a bounce engine, a putting engine, and the levels. I'd like to have each level in its own class, with the main class containing the engines and having something like this in it.
    <code>
    if (ballGoesInHole)
    holeOn = holeOn + 1;
    if (holeOn = 2)
    runLevel2Class();
    </code>
    Of course, there would be more if (holeOn = hole) statements. The problem? I'm not sure how to do it. The Level?Class() would just make the next level, and have to physics whatsoever. It would just draw. The physics engine would have to refer back to sprites created in the Level Classes. Is this even possible? If it can be done, how?

    qwerty96 wrote:
    Ok, I think I've got a handle on that. Just one thing, however. I have an arrayList that will be added to in the other classes. So if I create an arrayList in The Main class, then how do I add to it in the other classes?Expose a public void addThing(Thing thing) method from the Main class, yes?
    You really really really need to go through [The Tutorials|http://java.sun.com/docs/books/tutorial/] (or something)... you're wasting your time asking basic questions, and we're wasting our time answering them.

  • HT4528 I have iPhone. Is it free to txt and call other iPhones ?

    I Have an iPhone. Is it free to talk and txt other iPhones ? With any providers ?

    Apple to Apple is only free to use iMessage. iMessage will only work when connected to wifi network. As far as being able to send text messages to friends with AT&T and Verizon you will need to set up service through a wireless carrier.
    Link below will explain a little more about iMessages and regular SMS/MMS text messages:
    http://support.apple.com/kb/HT3529

  • Problems compiling when calling other classes

    hello,
    following the Sun tutorial "How to build a application" i wrote this code...
    package divelog;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class DiveLog extends JFrame{
         // make space in memory for a tabbed pane - not a object until constructor is called to initate
         private JTabbedPane tabbedPane;
         public DiveLog(){ //opens constructor - constructor iniaties objects
              super("Jason's DiveLog"); // super calls jframe - this is cause DiveLog extends JFrame
              addWindowListener(new WindowAdapter() // closes program form clicking "x" on the Jframe
              { //opens addWindowListener method
                   public void windowClosing(WindowEvent e){
                        System.exit(0);
         tabbedPane = new JTabbedPane(SwingConstants.LEFT);
         //tabbedPane.setBackground(Color.blue);
         //tabbedPane.setForeground(Color.white);
         // method to add tabs
         populateTabbedPane();
         //method builds menu
         buildMenu();
         // put on JFrame and set sizes
         getContentPane().add(tabbedPane);
         pack();
         setSize(765,690);
         setBackground(Color.white);
         setVisible(true);
         } //ends constructor started on line 13  - DiveLog()     
         // Methods -- for the constructor
         private void populateTabbedPane(){
              tabbedPane.addTab("Welcome",
                                                                null,
                                                                new Welcome(),
                                                                "Welcome to Jason's Dive Log");
              tabbedPane.addTab("Diver Data",
                                                                 null,
                                                                 new Diver(),
                                                                 "Click here to enter diver data");
              tabbedPane.addTab("Log Dives",
                                                                null,
                                                                new Dives(),
                                                                "Click here to enter dives");
              tabbedPane.addTab("Stats",
                                                                null,
                                                                new Statistics(),
                                                                "Click here to calculate stats");
         } // ends tabbed pane method
         private void buildMenu(){
              JMenuBar mb = new JMenuBar();
              JMenu menu = new JMenu("FIle");
              JMenuItem item = new JMenuItem("Exit");
              menu.add(item);
              mb.add(menu);
              setJMenuBar(mb);
              item.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e){
                        System.exit(0);
         }// ends buildMenu method
    } //ends class
              then... i made the welcome, dives,diver.... classes ...they look like this...
    package divelog;
    import javax.swing.*;
    import java.awt.*;
    public class Welcome extends JPanel{
    }all the .java files are in /home/mohadib/java_restore/DiveLog/
    so per the tutorial i try to compile with this.....
    javac -classpath /home/mohadib/java_restore/ DiveLog.java
    but i get this error....
    mohadib@mohadib ~/java_restore/DiveLog--->javac -classpath /home/mohadib/java_restore/ DiveLog.java
    DiveLog.java:48: cannot resolve symbol
    symbol : class Welcome
    location: class divelog.DiveLog
    new Welcome(),
    ^
    DiveLog.java:53: cannot resolve symbol
    symbol : class Diver
    location: class divelog.DiveLog
    new Diver(),
    ^
    DiveLog.java:58: cannot resolve symbol
    symbol : class Dives
    location: class divelog.DiveLog
    new Dives(),
    ^
    DiveLog.java:63: cannot resolve symbol
    symbol : class Statistics
    location: class divelog.DiveLog
    new Statistics(),
    ^
    4 errors
    could some one please tell me what im doing wrong :)
    Thanks,
    jd
              

    found the problem...
    i used this at the top of all the .java files....
    package divelog;
    then my dir tree looked like this....
    /home/mohadib/java_restore/DIveLog
    so i changed to
    /home/mohadib/java_restore/divelog
    and compiled with this....
    javac -classpath /home/mohadib/java_restore DiveLog.java
    then ran it with this.....
    java -classpath /home/mohadib/java_restore divelog.DiveLog
    thanks,
    jd

  • Passing values and links

    I have two related fields on the form and would like to know how to hide one and have it relate to the other field automatically. I would also like to know whether it is possible to pass a value to four different forms and do the fields you are passing the values have to have the same names? Thanks for your help

    I am assuming then that no one has attempted this on the forum?

  • I recently got a 5S, and when I am using the phone, my cheek seems to tap the screen, and calls other people, or mutes, or enables some of the other features that are not shutting down when I am talking to someone.  Can someone help, please!

    I recently got the iPhone 5S, and when I am talking, my cheek will touch the various buttons on the scene, and I am calling, going mute, or touching the keypad, and such.  How can I get the phone screen to stop doing this while I am talking.  I have IOS 8.  Thank you.  Please reply in simple terms, as I am not the best at understanding how to fix things.  Thanks again.

    First, try a reset to see if that clears it up:
    Hold down the home button and the power button together until the screen goes black and the Apple logo appears, then let go of the buttons. This will not cause any data loss and is like a reboot for your phone.

  • How to pass values and see outout of PL/SQL Tables, SYS_REFCURSORs?

    I am new to SQL Developer (Version 3.0.02).
    Our QC division wants to test stored procedures using SQL Developer.
    I tried to test procedures with PL/SQL tables and SYS_REFCURSORS as input and output parameters.
    When we run it by pressing the green arrow we get the Run PL/SQL window.
    How can we:
    - Put values to SYS_REFCURSOR and PL/SQL table type input parameters?
    - How can we display SYS_REFCURSOR and PL/SQL table type output parameters?
    All this time we were using SQL*Navigator. In Navigator the PL Tables and SYS_REFCURSORs outputs are shown in a nice grid.
    Here, in SQL Developer, do we have to WRITE our own code to input and display these types of parameters????

    Hi Channa,
    Yes in SQL Developer 3.0 you will have to write your own code to test out ref cursors.
    I had created test harness scripts for all my procedures having ref cursors as parameters.
    And I had to dbms_output all the values on the screen.
    Probably a limitation of the SQL Developer 3.0 tool.
    In case you come across different solution to this do let me know also.
    Thanks,
    Viju
    blog: http://whizdba.wordpress.com

  • Passing paramters and calling a PCUI screen from a BSP Application

    Hi,
    We have developed a custom BSP application which displays a list of Opportunities in a HTMLB table view based on a search criteria.
    When I click on a particular opportunity no., I should call a PCUI screen which should display that particular opportunity details.
    Any help is greatly apperciated.
    Thanks,
    Vasu.

    You are going to have to be more specific in what you want.
    First I would read the following pieces of info.  They will help you with general problems, also with creating an Iterator and read the select rows of a table.
    BSP Element - Dynamic tableView with Internal Table
    <a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator">BSP Programming: HTMLB TableView Iterator</a>
    Just shooting from the hip I am assuming you are clicking on a selected ROW in the tableView where you defined the tableView with <i>selectionMode="SINGLESELECT"</i> and <i>onRowSelection="MySelectEvent"</i> then on the OnInputProcessing Event Handler you read the selected row (see <a href="TableView and selected row)
    So and of course once you read the selected row in the OnInputProcessing event handler you can do further porocessing.
    However if you are wanting to provide the user with the ability to click an icon or text link in the row then please refer to the Iterator for that.

Maybe you are looking for