Documentos de Académico
Documentos de Profesional
Documentos de Cultura
In a Java application, you may have many classes. Within those classes, you
may have many methods. The method that you need to execute first should be
the main() method.
Syntax for the main() method:
public static void main(String args[])
{
}
The main () method should exist in a class that is declared as public.
A Java application (like DateApp in the code listed above) must contain a main()
method whose signature looks like this
Here, pkg is the name of the package. For example, the following statement creates
a package called
All applets are subclasses of the Applet class in the java.applet package. Applets
do not have main() method. All applets must be declared public. An applet displays
information on the screen by using the paint method. This method is available in
java.awt.Component class. This method takes an instance
6. Describe about:
a) Swing
b) JFC
a) Swing
Swing is the next-generation GUI toolkit that Sun Microsystems created to enable
enterprise development in Java. By enterprise development, we mean that
programmers can use Swing to create large-scale Java applications with a wide
array of powerful components. Swing components are an enhancement to the
existing Abstract Window Toolkit (AWT) components and are not intended to replace
AWT components. Both types of components can be used in the same
interface. Swing components range from basic controls such as buttons, check
boxes, scrollbars, and sliders to complex widgets like text panes and editor panes.
Unlike AWT components, Swing components are not implemented by platformspecific code; instead, they are written entirely in Java and, therefore, are