How to call an applet on click of a button in core java?

On this, I suggest that if we can call commond prompt on background and then pass the path of the class file of another applet we can open another applet on clicking on the button what u says ? if any suggestions or code u can give it is our pleasure to know that.

If you are asking if you can execute an external process (application/applet) from another application/applet - the answer is yes and no.
Yes. If you have the security settings/policy to do so.
No. This may require a security policy to be allowed - as an applet.

Similar Messages

  • How to call a method by clicking on a button

    hi, I have made a jsp page where I define a method toto.
    what the html source code for a button wich when you click it will process this method ?
    thanx

    There is no HTML source (or Javascript source either) that can directly call your toto JSP method. Think of it like this. You want to send a request from the browser to tell the JSP page to run method toto. For example, if the JSP page is named myPage.jsp, then the request could be as simple as myPage.jsp?action=runtoto (or http://yourwebserver/your/page/path/myPage.jsp?action=runtoto as an absolute URL). The JSP would then need to look for the action parameter as it is sent from the browser. If the action parameter equals "runtoto" then you could call the run tot method. Example:
    <%String action = request.getParameter("action");
    if(action.equalsIgnoreCase("runtoto"))
       toto();%>
    This could be coded in myPage.jsp and would run the toto method whenever the browser requested it via the action parameter. The HTML for the request could be coded as a button, a hyperlink, or anything that would generate a new page request.
    <form action="myPage.jsp" method="GET">
    <input name="action" type="button" value="runtoto"> Click to run the toto method.
    </form>
    Of course you have to consider the other parameters that will be submitted with the form. This may present some design issues/questions.

  • How to call a Applet from a servlet and vice versa...?

    Hi all
    Can anyone help me how to call a applet from a servlet and vice versa. When the applet is called it should contact the database (oracle8i) and get the data. When i submit the applet form the data in the applet should be saved in the database.
    Thanks in advance
    Kamalakannan

    Sweep is correct about requestDispatcher being another approach for inter-servlet delegation; the only issue that i recall with this approach is that it defaults the method of the destination servlet to the one it was called from...for example, calling servlet2 from within servlet1.post() resulted in the dispatcher attempting to utilize servlet2.post() - i believe that i searched for a parameterize solution to no avail :( (ended up handling the request by placing a "fake" doPost() in servlet2 that simply called servlet2.doGet())
    however, if your application is functioning correctly on your pc/webserver then the problem may be external to servlet communication (e.g. client webserver's ports not configured or blocked, missing runtime classes, etc.)
    my suggestion would be to set aside the programmatic concerns for the moment - what is the response if you open a browser on a client's machine and access the URL in question (i.e. http://clientserver:port/stefanoServlet)? If it will not respond to access in this manner then it certainly won't when your application calls for it.
    It's possible that there is a coding error but, given the info supplied, i'd start examining the environment, first. Let us know if you have any luck with the test i recommended or not (please provide abundant detail). Or, if you've found the solution then you may want to post back with a quick blub so the next person knows how to escape the trap.
    D

  • How to call this out by clicking button from other file??

    The following coding is easy and workable...!! i wonder how do i call this out by clicking button from other file... please help!!
    import java.awt.geom.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.print.PrinterJob;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class Receipt extends JPanel implements Printable, ActionListener {
    final static Color bg = Color.white;
    final static Color fg = Color.black;
    final static Color red = Color.red;
    final static Color white = Color.white;
    final static BasicStroke stroke = new BasicStroke(2.0f);
    final static BasicStroke wideStroke = new BasicStroke(8.0f);
    final static float dash1[] = {10.0f};
    final static BasicStroke dashed = new BasicStroke(1.0f,
    BasicStroke.CAP_BUTT,
    BasicStroke.JOIN_MITER,
    10.0f, dash1, 0.0f);
    final static JButton button = new JButton("Print");
    public Receipt() {
         setBackground(bg);
    button.addActionListener(this);
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() instanceof JButton) {  
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    catch (Exception ex) {
    ex.printStackTrace();
    public void paintComponent(Graphics g) {
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D) g;
         drawShapes(g2);
    public void drawShapes(Graphics2D g2){
    g2.drawString("Hello world",50,50);
    public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
    if (pi >= 1) {
    return Printable.NO_SUCH_PAGE;
         drawShapes((Graphics2D) g);
    return Printable.PAGE_EXISTS;
    public static void main(String s[]){
         JFrame f = new JFrame();
         JPanel panel = new JPanel();
         panel.add(button);
         f.getContentPane().add(BorderLayout.SOUTH, panel);
         f.getContentPane().add(BorderLayout.CENTER, new Receipt());
         f.setSize(580, 500);
         f.show();

    The following coding is easy and workable...!! i wonder how do i call
    this out by clicking button from other file... please help!!Copy the code from your main() method and put it into the actionPerformed() method of the other class. If you do not need to reference the instance of Receipt from the othe class, it is that easy.

  • How to call an applet from a first applet

    Hi,
    I need to call an applet from a first applet, but I want that the called applet doesn't execute in the same AppletContext than the first one, is it possible?
    If it is, what is the solution?
    Thanks

    Yes, it is possible. One way would be to use static variables.
    class A1 extends Applet
       public static A2 TheOther;
       public A1()
          A2.TheOther = this;
       public void callA2()
          TheOther.doSomething();
    class A2 extends Applet
       public static A1 TheOther;
       public A2()
          A1.TheOther = this;
       public void doSomething()

  • How to call a method on click of selectOneChoice dropdown box

    Hi,
    I am using selectOnceChoice whose list is coming from an arrayList.
    On the load of my page, I am populating the arrayList and it is getting visible in the selectOneChoice dropdown.
    But I have a scenario where I need to populate the arrayList(List Items) for selectOnceChoice on click of selectOnceChoice box. Not at the time of page load.
    I tried to do that with the help of clientListener and ServerListener but it seems that it is ServerListener is not the child attribute of selectOnceChoice.
    Can anyone please help me out to perform or call a method on click of selectOnceChoice box.
    Thanks,
    Vicky

    Could someone please explain to me the main difference between adapters and listeners? WindowListener is an interface, if you use it then you have to implement all its methos whether you use then or not while WindowAdapter is a class which implements WindowListener and provides empty implementations of all the methods in the listener, so basically by using windowAdapter you are avoiding
    the implementation of methods which you don't required.

  • How to close main window on click of a button on popup window

    Hi All,
    I have created a web page which on certain condition display a popup window to to provide information. Wht i want is that when i click on close button on my popup window, my main window should also close.
    Can anyone please help with this requierment!!!
    Regards,
    tushar

    Hi All,
    Could anyone of you please help me by answering the thread
    WDDOEXIT method not called when the application is closed from the portal
    Thanks,
    Subash M

  • How to open a window on click of a button?

    Hi,
    I want to open a window(a new browser page) on the click of a button.Can anyone please tell me what i should write in the onAction of the button?
    Regards,
    Padmalatha.K

    hi,
    1.Declare the following in the implementaion of the component controller
    //@@begin others
      IWDWindow modalWindow;
      //@@end
    2.First create a method in the component controller :
    public void createExternalWindow( )
        //@@begin createExternalWindow()
        // create external window
        IWDWindow externalWin = wdComponentAPI.getWindowManager().createNonModalExternalWindow
                                                            ("http://www.google.co.in/", "External");
        //Define window position and dimensions according to acreen parameters
        externalWin.setTitle("Google");
        externalWin.setWindowPosition(WDWindowPos.CENTER);
        externalWin.setWindowSize(1280,850);
        externalWin.show();
        //@@end
    3.Create a button in the view, create an action. assign this action to the button . Now call the method in the view controller.
    public void onActionexternal(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionexternal(ServerEvent)
        wdThis.wdGetPopUpCompController().createExternalWindow();
        //@@end
    Now to create a modal window
    1.Declare the following in the implementaion of the component controller
    //@@begin others
      IWDWindow modalWindow;
      //@@end
    2.Create a new window "NewPopWindow".Declare the following in the implementaion of the component controller.
    public void createModalWindow( )
        //@@begin createModalWindow()
        //creating the window
        IWDWindowInfo winInfo = wdComponentAPI.getComponentInfo().findInWindows("NewPopWindow");
           modalWindow = wdComponentAPI.getWindowManager().createModalWindow(winInfo);
        //display window in centre
        modalWindow.setWindowPosition(WDWindowPos.CENTER);
        modalWindow.setTitle("Modal Window");
        modalWindow.setWindowSize(400,100);
        //opening the window
        modalWindow.show();
        //@@end
    3. destroy the window
    public void destroyModalWindow( )
        //@@begin destroyModalWindow()
        modalWindow.destroyInstance();
        //@@end
    4.Create a button in the view, create an action. assign this action to the button . Now call the method in the view controller.
    public void onActionmodal(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionmodal(ServerEvent)
       wdThis.wdGetPopUpCompController().createModalWindow();
        //@@end
    regards,
    pinki
    Edited by: pinki goswami on Apr 17, 2008 11:42 AM

  • How to call initial screen from Sm30 screen back button

    Hi All,
    I have written a program to call SM30 transaction using BDC method.The values entered on initial screen of report are being passed on to SM30 screen through BDC . As per selection criteria inserted on screen only those particular entries are being displayed on SM30 table maintenace screen.
    But when I click on BACK button on table maintenace screen of SM30 it takes me to first screen of SM30 ransaction instead of report's first screen.
    What do I have to do to move on to first screen of report when BACK button clicked .
    Thanks
    Saurabh

    Creata table maintenance generator for your table. You need not have to do a BDC to SM30 to maintain the table. You can use the FM "VIEW_MAINTENANCE_CALL" by passing the table name. This will also take in the criteria to filter the record in the table display. Now if you press back button from here it will take you back to your report screen.
    Regards
    Ranganath

  • Move to the parent applet on clicking the back button

    Hey,Every Body!
    I am trying to make a project in which i have a problem , my project has mutiple applets and i want that on clicking on the back button current applet should be closed and instantly the parent applet should be opened.
    Please help me to solve this problem.
    Thanks

    Hey, you can take any two applets , i only want to move the parent applet on clicking on the back button .
    For Example suppose on the first applet i have inserted my username and emailid then on clicking on the next button , second applet is opened in which i have to submit my personal details like my name, my address, my phone number ,but instantly i thought to change my email id or my username in that case i want that there should be a button on the second applet on clicking of which second applet should be closed and the parent applet should get focused again.

  • JDev 10.1.3 ADF: How to fire an event when clicking a Radio Button

    I have a <af:table> component with the following code for my radio button
    <af:tableSelectOne text="Select and"
    binding="#{backing_viewFees.tableSelectOne1}"
    id="tableSelectOne1"
    attributeChangeListener="#{backing_viewFees.tableSelectOne1_attributeChangeListener}"
    autoSubmit="false">
    When I click the radio button it does not fire up my event in my backing bean?

    Thank you for the suggestion...it does work and fires the event, but it is still not selecting the current record when I try to perform an Update or Delete.
    I had to modify your code a bit in order for it work in JDev 10...used the JUCtrlValueBindingRef instead of the FacesCtrlHierNodeBinding.
    Here is what my af:table tag looks like:
    <af:table value="#{bindings.FeesView1.collectionModel}"
    var="row" rows="#{bindings.Fees001View1.rangeSize}"
    first="#{bindings.FeesView1.rangeStart}"
    emptyText="#{bindings.FeesView1.viewable ? \'No rows yet.\' : \'Access Denied.\'}"
    selectionListener="#{backing_viewFees.tableSelectOne1_attributeChangeListener}"
    binding="#{backing_viewFees.table1}" id="table1">
    If I put back my 2 original attributes, then my Delete and Updates work.
    selectionState="#{bindings.FeesView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.FeesView1.collectionModel.makeCurrent}"
    Here is my code in the backing bean:
    public void tableSelectOne1_attributeChangeListener(SelectionEvent selectionEvent) {
    JUCtrlValueBindingRef binding = (JUCtrlValueBindingRef)this.getTable1().getSelectedRowData();
    if (binding != null) {
    Row currentRow = binding.getRow();
    if (currentRow != null) {
    System.out.println(currentRow.getAttribute("CurrentRecordInd")); // this does print my selected value!!!!
    }

  • How to call a method on clicking Search Button in a jspx page.

    Hi All,
    I made a simple search page with two search criteria. Also i used LOV's for selecting the values to these view criteria's.
    Now i need to validate the criteria's being passed before page renders. Based on the validation i would like to change my base query of the page.
    Is this is possible to have two different query for the same page.
    If yes then please guide me to achieve this !!!
    Regards
    Siva

    Hi Arun ,
    Thanks for the reply,
    This is the actual scenario,
    I need to allow user to querying using a particular atrribute say A1 but applying A1 directly as a criteria on my base query along with other criteria will not fetch any details.
    Instead
    I need to fire the same query with A1 alone initially and on top of the fetched results i need to apply the other criteria
    OR
    I need to get the A1 from user and fetch some other attribute let's say A2 corresponding to A1 and this A2 has to applied as the new attribute along with the other attributes.
    Can this be achieved.
    Regards
    Siva
    I am using jdev 11.1.1.6

  • How to open a form on click of a button in infopath

    I have created an infopath form on a list. I need to create a button on the pape on click of which the last item created by the user should open. I mean the edit form of that list item should open. 
    How can we do this ?
    Thanks for your response in adv.
    Regards,
    prajK

    Hi,
    Per my understanding, you might want to add a button on a page, when clicking it, the last form which is created by the current user will open.
    As it might require to query the last form created by current user, custom code would be required.
    A solution is that, you can query the URL of the last form created by the current user using JavaScript Client Object Model, generate a button with the URL retrieved
    using JavaScript. Then when user open this page, the button will be created dynamically, user clicks it, the last form created by this user will open.
    More information about JavaScript Client Object Model:
    How to: Create, Update, and Delete List Items Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx  
    Common Programming Tasks in the JavaScript Object Model
    http://msdn.microsoft.com/en-us/library/office/hh185015(v=office.14).aspx
    About how to create a button using JavaScript:
    http://stackoverflow.com/questions/7707074/creating-dynamic-button-with-click-event-in-javascript
    Thanks 
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to Handled Shift +Tab(Focus) click in radion button?

    Hi,
    I am using Jdeveloper 11.1.2.0.
    My scenario is one radio button having three items(Left,Right,Center). Now my radio button focus is first radio(Left). Now I click the the tab sequence. It will go to the next field, whether it is input field.
    Suppose Now I am come to back ward like shift+Tab it is come to the radio button. Here what is happening mean the focus is going to the Last radio button item(Center), what I want is which radio Item I select Initially ,the Same Place cursor want to go. How to proceed to this. Please give some suggestion to proceed.
    Regards,
    Ragu

    Hi,
    so what you are saying is that the tab focus navigation bypasses the other radio buttons whereas tab back focus navigation doesn't. If this is the case, and due to missing information in your question, try this
    set autosubmit="true" on the radio group so the radio button selection is saved.
    If this doesn't help, please provide information about the implementation of how you created the radio group and which data they are bound to. Chances are that this indeed needs to be filed as a bug but also that it is a problem in your model
    Frank

  • How to generate a mail on click of save button on Module pool program.

    Hi geeks,
    I am developing a Module pool having table control..The table control is supposedly having  10 columns. The user enters values in first 5 colmns and when he saves , a mail should be  generated to his hierarchy indicatiing it .How could this be achieved?? . The mail should just have  details like the i/p entered in screen . If possible explain through  a code snippet..
    Thanks in advance
    Regards,
    Navin

    when you press save button, get the sy-ucomm and write the below code. Capture the entries from
    table control and send the mail.
      DATA : it_objpack   TYPE STANDARD TABLE OF sopcklsti1 ,
             it_objtxt    TYPE STANDARD TABLE OF solisti1 ,
             it_objbin    TYPE STANDARD TABLE OF solisti1 ,
             it_reclist   TYPE STANDARD TABLE OF somlreci1 ,
             wa_doc_chng  TYPE sodocchgi1,
             wa_objhead   TYPE soli_tab,
             l_attachment TYPE i,
             l_testo      TYPE i.
      DATA:   wa_objpack TYPE sopcklsti1,
              wa_objtxt TYPE solisti1 ,
              wa_objbin TYPE  solisti1 ,
              wa_reclist TYPE  somlreci1 .
      CLEAR:  wa_reclist,
              wa_objhead,
              wa_objtxt,  it_objtxt[],
              wa_objbin,  it_objbin[],
              wa_objpack, it_objpack[].
      CLEAR wa_objbin.
      REFRESH it_objbin.
      it_objbin[] = gt_mess_att[].
      DESCRIBE TABLE it_objbin LINES l_attachment.
      LOOP AT it_message INTO wa_message.
        wa_objtxt = wa_message. APPEND wa_objtxt TO it_objtxt.
      ENDLOOP.
      DESCRIBE TABLE it_objtxt LINES l_testo.
      wa_doc_chng-obj_name = 'Test'.
      wa_doc_chng-expiry_dat = sy-datum + 10.
      CONCATENATE 'Send '
                    INTO wa_doc_chng-obj_descr .
      wa_doc_chng-sensitivty = 'P'.
      wa_doc_chng-obj_prio = '1'.
      wa_doc_chng-doc_size = l_testo * 255.
      CLEAR wa_objpack-transf_bin.
      wa_objpack-head_start = 1.
      wa_objpack-head_num   = 0.
      wa_objpack-body_start = 1.
      wa_objpack-body_num   = l_testo.
      wa_objpack-doc_type   = 'RAW'.
      APPEND wa_objpack TO it_objpack.
      CLEAR wa_reclist.
      wa_reclist-copy = 'X'.
      IF wa_email IS NOT INITIAL.
        wa_reclist-receiver = wa_email-value1.
        wa_reclist-express  = 'X'.
        wa_reclist-rec_type = 'U'.
        wa_reclist-notif_del = 'X'.
        wa_reclist-notif_ndel = 'X'.
        APPEND wa_reclist TO it_reclist.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = wa_doc_chng
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_objpack
            object_header              = wa_objhead
            contents_bin               = it_objbin
            contents_txt               = it_objtxt
            receivers                  = it_reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        IF sy-subrc <> 0.
          WRITE 'mail fail'.
        ENDIF.
      ENDIF.

Maybe you are looking for

  • Windows thinks my ipod touch is a digital camera. How do I change this so itunes can see it?

    Windows thinks my ipod touch is a digital camera. How can I change the device in windows, so that i can re-register it as an ipod and itunes can connect with it.?

  • Graphic artifacts

    Hi there Since I upgraded to Snow Leopard, I have this problem with Safari when opening a new tab. Some scrambled images from windows that even aren't open anymore appear before the new tab opens. Is this a known issue? Can it be fixed?

  • Files Created in SMB Missing via AFP

    Hello all, We have files created by an automated process on a Windows 2003 Server, and copied to a shared folder (Windows and Macintosh.) When a user connects to that share via AFP, they don't see those files. However, when they connect to the share

  • Extract text from Powerpoint

    Can anyone tell me whether it is possible to extract text from Powerpoint. Please help me out.

  • Set up Non Disruptive Sql Auditing

    What is the best way to set up a non disruptive way of Auditing SQL.  It's for SQL 2005, on a Server 2003 box.  Thanks in advance