Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

java Applet - Application (xappapp)

This produces most of the file (no header comments, package declaration, or imports) that is the skeleton of both an application and an applet.

  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
////////////////////////////////////////////////////////////////// ${Identifier}
public class ${Identifier} extends JApplet {
//================================================================ constants

//=================================================================== fields

//===================================================================== main
public static void main(String[] args) {
//... Create and initialize the applet.
JApplet theApplet = new ${Identifier}();

//... Create a window (JFrame) and make applet the content pane.
JFrame window = new JFrame("${Identifier}");
window.setContentPane(theApplet);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.pack(); // Arrange the components.
//System.out.println(theApplet.getSize());
window.setLocationRelativeTo(null); // Center the window.
window.setVisible(true); // Make the window visible.
}

//============================================================== constructor
public ${Identifier}() {
//... Create Applet/content pane GUI here.
}
}

No comments:

Post a Comment

Archives