sapdev logo background
sapdev logo sapdev logo
Comments

Example Java code to create Applet




Creates Java Applet for information to be displayed in.


package ws;  //Comment out or replace with own package declaration


//import com.sap.mw.jco.*;
import javax.swing.*;          //This is the final package name.
//import com.sun.java.swing.*; //Used by JDK 1.2 Beta 4 and all
			       //Swing releases before Swing 1.1 Beta 3.
import java.awt.*;
import java.awt.event.*;
//import java.applet.Applet;
//import java.util.*;

public class CallSapApplet extends JApplet  implements ActionListener, ItemListener {

	JLabel valueLabel, convertedValueLabel;
	JTextField valueField, convertedValueField;
	JButton convertButton, restartButton;
	
	public void init() {

		Container container = getContentPane(); //.add(contents, BorderLayout.CENTER);	
		container.setLayout(new FlowLayout());
					

		
//		Create the top-level container and add contents to it.
		JFrame frame = new JFrame("SwingApplication");
		CallSapFunc app = new CallSapFunc();

		CallSapSwing swingapp = new CallSapSwing(app.myArrList);

		Component contents = swingapp.createComponents();
		container.add(contents, BorderLayout.CENTER);					
	}
	
	

	public void itemStateChanged(ItemEvent ie) {
	}

	public void actionPerformed(ActionEvent ea) {
	}
}




comments powered by Disqus