Can we use a method in addActionListener ??

Hello Everyone,
can anyone tell me how to use a method in addActionListener ?
if u have any example , plz send me
Thanks & Regards

[url http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html]How to Write an Action Listener
You can invoke your method when you provide implementation for the actionPerformed(...) method.

Similar Messages

  • Can i use Response method in livecycle designer to render or open pdf doc?

    Hello,
    Can anybody please tell me is it possible to use response method available in the adobe livecycle designer which takes the input value to open the pdf doc.
    Case 1: if we send adobe form throgh mail as pdf doc,then at the receiver side if the user open the pdf doc a popup should come asking for the input value.This popup will be from the response method.
    Case 2:if we save the adobe form as pdf doc on to our desktop and then if we try to open the pdf doc a popup should come asking for input value.
    Is it possible to do ?
    If yes then in which event of livecycle designer we should write that response method and in what way?
    If no,is there any other way to do this?
    Thanks in advance,
    Menaka

    Yes i have tried in other events of livecycle designer.
    In Formready event -> if i do preview pdf,first it will display form and then it ll ask for password.But with this event only if i save the pdf to my local desktop and try to open it ll not ask for password anywhere.
    In Layoutready event ->Pdf preview in designer is working fine,but when i save it my local desktop and try to open it ll not ask for passward.
    Could anybody tell me how to do it.
    Menaka.

  • Can I use object methods in a class

    I have a class ball and I am in the process of creating it's move method. I want this method to make the ball move depending on certain factors.
    One of these factors being where a bar has been stopped. I have a bar class which extends JProgressBar and when stopped, produces a number. I want this number to be available to my ball class in some way so it can use it to determine how far the ball has to move. The number can be output using its method getValue() but I am unsure how this can be used by another class.
    I doubt this is possible, but I am sure there are ways to achieve what I want. Any help on this subject would be great.

    Methods in one class can call methods defined in another class, subject to access restrictions (public, protected, package-private). This is pretty basic, so you should be able to get the meat of it from your text or tutorial. Look there, or in the following for explanations and examples, and post again if you can't get your code to work.
    http://java.sun.com/docs/books/tutorial/
    http://java.sun.com/learning/new2java/index.html
    http://javaalmanac.com
    http://www.jguru.com
    http://www.javaranch.com
    Bruce Eckel's Thinking in Java
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java

  • Can we use call method or call action in dynpro.

    hi all,
    In the view of a web-dynpro, can we call one action inside another action..?
    or can we call a method inside an action..
    if so plz help...
    thanks in advance,
    jithin.

    Hi Jithin,
    Suggest you that, you keep your logic in a method which you are using for create(event).
    the same method you can call in modifyview so that after you create again the modifyview will get trigger and then it fills your dropdown.
    or
    after create functionality is done then call a method to fill the dropdown.
    try to modularize your code using methods then you can
    re-use it.
    still you need any clarificatinos let me know.
    Regards,
    Mahesh

  • How can i use C# method to SAP IDoc

    Dear Friends
    i have to do one scenario in which i have to connect to database let us say SQL Server but i can't touch Database directly i can call a C# method(3rd party application is in .NET) and using XI i have to send it to SAP iDOC.
    can any one help me in this how to proceed
    Thanks in Advance.
    Ishika

    <i>Do you have any document for that on how to do it with webservices.</i>
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    See this
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2131 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Regards,
    Prateek

  • Can I use  a method in super()

    Hi,
    I hope to use a method in super(). Can I?
    like this
    public Example(Class1 obj1, Class2 obj2){
    super("This is an example"+getString());
    public String getString(){
    return string;

    It can be compiled successfully. Then you have a serious compiler bug. Report it to the vendor and start using another compiler.
    But this method
    getString() cannot be revoked. I have no idea what you mean by that?
    So I hope to know if
    there are some ways to use methods in super()?If your compiler was working, it'd tell you that instance methods can not be invoked here.
    Class (static) methods however, are fine.

  • Can i use 2 methods to deploy icon files in Oracle IDS?

    Dear all,
    I'm using Oracle 9IDS(Forms) and i'm trying to use 2 methods to deploy icon file:
    -In development phase, i use defaul.icon.path and defaul.icon.extension in registry.dat file and imagebase=documentbase. My icon are well deploy when i run application from form builder.
    -In deployment phase, on the same plateform, i use jar file following these steps:
    1- I store jar file in same directory with all runtime files(fmx, mmx, etc.)
    2- i create a virtual path(/forms90/Tel/) to map with this directory
    3- in formsweb.cfg, i put the following line:
    [myapp]
    imagebase=codebase
    archive_jini=f90all_jinit.jar,/forms90/Tel/images.jar
    When i call my application directly (http://localhost:8889/forms90/f90servlet?config=myapp),
    icons don't appear.
    I would like to know, what's wrong?It's possible to use theses both methods for deploy icons on the same plateform?
    Thank u for your help

    Hi Franck,
    I thank that red correctly the document(how deploy icon on web).But that isn't the matter.I update my formsweb.cfg as you advise me
    [myapp]
    archive_jini=...,/forms90/images.jar
    imagebase=codebase
    Icon don't appear at runtine while other gif files(splashscreen,logo) appear.Notice these others gif files are compressed in the same jar file. Notice also, that when i use default.icon.path parameter in registry.dat file, icons are well deployed.
    It's incomprehensible.
    Thanks you for your help!

  • Can we use equals method in JSTL

    hia all,
    is there is possible to use equals method in JSTL c:when tag. if so please give me an example or else please tell me some solution.
    regards
    subramanian

    Have you tried it anyway? Where exactly are you talking about with "contents"?
    Remember that the == operator in JSTL isn't the same as the == operator in Java. In JSTL it invokes the Object#equals() method behind the scenes, while in Java it checks the equality of the reference.

  • Can't use inherited method with JButton

    I am trying to use the getActionListeners() method on a JButton. The method is inherited from the AbstractButton class. However, when I try to compile with this line...
    ActionListener CurrentListeners[] = OKButton.getActionListeners();I get the following error:
    Method getActionListeners() not found in class javax.swing.JButton.
    I am also using the removeActionListener() method, which is inherited from the same object, and the compiler has no problem with that!

    Okay, then does anyone know how I can change the
    ActionListener for a JButton? I want to use the
    removeActionListener(ActionListener l) method and then
    addActionListener(...). However, since I can't get
    the current ActionListener, I have nothing to pass
    into the remove method.It's my belief that's this is why this method was added to AbstractButton in JDK 1.4. It makes life so much easier. Why don't you download the JDK 1.4 and install it into your IDE?
    Otherwise, you should subclass JButton as someone else suggested and provide an accessor method for the listener.

  • How can I use instance methods created with HashMap

    class Template
    static HashMap customer;
    a few methods created various customer
    public static display() //to display a particular customer information among i've created above
                 String objectName,currentObjectName;
              Customer customer;
              Scanner scan=new Scanner(System.in);
              System.out.print("Please enter the customer name");
              objectName=scan.nextLine();
              Iterator iteratorForCustomer=CustomerMap.entrySet().iterator();
              Map.Entry customerEntry=(Map.Entry)iteratorForCustomer.next();
             while(iteratorForCustomer.hasNext())
                    customerEntry=(Map.Entry)iteratorForCustomer.next();
                    if(objectName.equals((String)customerEntry.getValue()))
              System.out.println("Name : " +customer.getName()); //I'm trying to reference to an instance method getName() here but i can't do that .
    }The problem is I've created as many as I want and later in the program I tried to redisplay a particular customer information based on the input (objectName). User type in the objectName and I tried to look for a particular customer Object in the HashMap and display only the relevant customer information. Is there any way to do it ? Thanks everyone in advance.

    Peter__Lawrey wrote:
    use the get method
    [http://www.google.co.uk/search?q=map+tutorial+java]
    [http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html]
    And then either look at a generics tutorial, or, if you're stuck on a pre-1.5 version of Java, find out about casting

  • How can I use staitc method?thanks!

    here is my code :
    class a
    void go()
    System.out.println("now you are calling a.go method!");
    public class b extends a
    public static void main(String args[])
    a t1=new a();
    t1.go();
    It can be compiled and excuted perfectly,but I read from book that "in static method ,we can olny call static variable or method....." ,but t1.go() method is not static method ,why? thanks!

    static methods cannot refer to the methods and variables in their scope. They can however instantiate an object and use it... just like you did in your code.
    Think about this.
    public class SuperString extends String{
      public static void test(){
        String hello = "Hello";
        System.out.println(hello + " The string length is: " + hello.length());
    }in this example whe have String class that we added a static function to. It is otherwise the same thing as a String. Notice how I can instantiate and use a String class, but If I tried something like this
    public class SuperString extends String{
      public static void test(){
        System.out.println(this + " The string length is: " + this.length());
    }it would fail.

  • Can subclass use a method in supercalss as the implementation of interface?

    Assume P is the superclass of S. S implements interface I. Both P and I have the same method m. Must I implement m in S?
    Thanks.

    It depends.
    If m is public then it is already inherited so you don't have to unless you want a overriding implementation.
    If m is private, it is not, so you have to.
    If it is protected, the Super Class method cannot hide the public method in the interface, so again, you have to.
    HTH.
    -o12

  • How to use POST method to send & recieve XML data in WebDynpro application

    Hi There,
    How can we use POST method in a Url (callign weebdynpro application) and pass XML String content. How can we read this this inside WD Application.
    Any pointers will be great help.
    Rgds

    Closed

  • Why am i able to use abstract methods id they aren't yet implemented?

    For example, why i can use this [http://docs.oracle.com/javase/7/docs/api/java/nio/CharBuffer.html#slice] if this is abstract?
    Edited by: 947971 on 13-set-2012 10.38

    947971 wrote:
    Yes, but if CharBuffer has a method declared:
    public abstract CharBuffer slice()So i can't use the method slice() because it's not implemented.
    And why , indeed, i'm able to use it?Because it is implemented by the actual class being used. You can't instantiate abstract classes, so there is a subclass of CharBuffer which does implement the method.
    If you take the interface Comparable, you see that it has an (implicitly)abstract method compareTo. A class that implements Comparable is Integer, so you can easily write:
    Comparable<Integer> i = new Integer(100);
    i.compareTo(new Integer(55));

  • Using a method return in a taskflow router

    I have a custom data control with following method:
    public String getOutcome(){
        String outcome;
        //do stuff
        if(something)
           outcome = "o1";
        else
           outcome = "o2";
        return outcome;
    }This method is dropped on the taskflow as method call.
    How can I use the return value of this method call to drive the decision of a router component of the taskflow?

    We can not used the method for decision the navigation rule.You have to use the router for resolving your issue.
    Or if you want to navigate through the method then inside your method you have to programmatically navigate to pages on the basis of diffenent condition.
    you can used following code for navigation .
    FacesContext fc = FacesContext.getCurrentInstance();
    Application application = fc.getApplication();
    NavigationHandler navHandler = application.getNavigationHandler();
    navHandler.handleNavigation(fc,null, "navigation case name"); Thanks
    Prateek

Maybe you are looking for

  • New to IPhone and have a few Questions?

    To start I want to say that I am a long time (25+ years) veteran of technology but am new the the IPhone. My IPhone is not Jailbroken and would like to keep it that way if I can. Allthgouh I did jailbrake it with blackra1n for about 30mins then I did

  • Conditional fields in PDF form

    The Situation is like this. No of Member:  1   2   3   4 Member Details: 1. Name                : 2. HKID No          : 3. Address             : 4. Phone No:          : 5. Email Id             : if number of memebers 1 the one time show the details 1

  • IMac's shutting down

    My wife and I both have the 20" iMac. Model ID "iMac 8,1. Today they both started shutting down randomly, like a complete power loss shut down. Once powered off, they will not turn back on, you hit the power button and nothing happens. The only thing

  • Hardware requirement for EBS R12 (12.1.3)

    Hi, Can any one please let me know what is the hardware requirement for EBS R12 (12.1.3) for 100 users and which going into be TEST instance. Thanks in advance. Thanks, Venkat

  • Deleting sections of a movie

    I imported a home movie into premier elements 10, and would like to delete some frames.  When I go to the scene line there is only 1 frame.  In the time line it extends for the whole movie. I do not see how you delete frames. Help.