Skip to main content

Featured

Adobe Experience Manager - Create an OSGI Configuration

 In this article, let's create an OSGi configuration, configure it and use it in AEM code. So now let's get started with the creation of an OSGi configuration. Technical details and Assumptions: All the following details are tested in AEM version 6.5.8, Java version 11.0.2 Creation of OSGi configuration: To create an OSGi configuration we need to create an ObjectClassDefinition. I have included a sample OCD configuration, which can be used as a reference to create one. The next step would be to create an interface and an implementation that can help fetch the OSGi configurations.  Interface: Implementation: Let's try to use the OSGi configuration created so far in Models/Servlets. For demonstration purposes, I used AEM Models here, but the same can be implemented in Servlets too. Now that we have created the OSGi configuration. Once building the code, we should be able to see the OSGi configuration in the web console (http://localhost:4502/system/console/configMgr) C...

Applet


In a applet create a frame with 2 text fields and 3 buttons,data entered in the first text field,should respond according to the button clicked

Program:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/**
 *
 * @author crsri
 */
public class mudiyala extends Applet{
    TextField t1 ;
        TextField t2;
        Button b1 ;
        Button b2 ;
        Button b3 ;
        String clipboard = "";
       
    public void init(){
       
        TextField t1 = new TextField(20);
        TextField t2 = new TextField(20);
        Button b1 = new Button("Cut");
        Button b2 = new Button("Copy");
        Button b3 = new Button("Paste");
        ActionListener a = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae)
            {
               
                if(ae.getSource()==b1){
            clipboard = t1.getText();
            t1.setText("");
           
        }
        else if(ae.getSource()==b2){
            clipboard = t1.getText();
           
    }
        else if(ae.getSource()==b3){
           
            t2.setText(""+clipboard);
        }
               
            }
        };
        add(t1);
        add(t2);
        add(b1);
        add(b2);
        add(b3); 
        b1.addActionListener(a);
        b2.addActionListener(a);
        b3.addActionListener(a);
               
    }

}


Output:

Comments

Popular Posts