Wednesday, 26 February 2014


How to create a child frame window from within an applet...........

Creating a new frame window from within an applet is actually quite easy.
The following steps may be used to do it,
  • Create a subclass of Frame
  • Override any of the standard window methods,such as init(),start(),stop(),and paint().
  • Implement the windowClosing() method of the windowlistener interface,calling setVisible(false)when the window is closed
  • Once you have defined a Frame subclass,you can create an object of that class.But it will note be initially visible
  • When created,the window is given a default height and width
  • You can set the size of the window explicitly by calling the setSize() method
The example program is  shown below:

// Create a child frame window from within an applet.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
<applet code="AppletFrame" width=400 height=60>
// Create a subclass of Frame.
class SampleFrame extends Frame {
SampleFrame(String title) {
// create an object to handle window events
MyWindowAdapter adapter = new MyWindowAdapter(this);
// register it to receive those events
public void paint(Graphics g) {
g.drawString("This is in frame window", 10, 40);
class MyWindowAdapter extends WindowAdapter {
SampleFrame sampleFrame;
public MyWindowAdapter(SampleFrame sampleFrame) {
this.sampleFrame = sampleFrame;
public void windowClosing(WindowEvent we) {
// Create frame window.
public class AppletFrame extends Applet {
Frame f;
public void init() {
f = new SampleFrame("A Frame Window");
f.setSize(150, 150);
public void start() {
public void stop() {
public void paint(Graphics g) {
g.drawString("This is in applet window", 15, 30);




  1. Each window in your home or commercial property is considered a system that is designed to eliminate or moderate sound, light, and air from entering a structure. As a secondary function, windows also function as a point exit or entry into homes. The window glass and window frame you choose can positively affect the operation of your home, including security, safety, interior and exterior decor, comfort, enjoyment of your outdoor landscape, and the energy efficiency of your entire home. painting services

  2. The initial thought of an entry enclosure gate might be that your home would look too fenced in, but there are many options to choose from. From custom to classic and simple designs, there are gates to complement any home and any sense of style.