Thursday, March 17, 2011

Executable .jar Files

import java.awt.*;
import java.awt.event.*;

public class MyClass {
public static void main(String[] args) {
Frame f = new Frame();
f.addWindowListener
(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
);
f.add(new Label("Hello world"));
f.setSize(200,200);
f.setVisible(true);
}
}

Bind Some Event to Element and trigger that function when click the element

Scenario: Suppose if we used same click event function in various web pages. if you want do some logic some page button for that need to re...