Hi!
I've 3 doubts.Can you please explain it with some example.
1.What's the difference between static and an object? why we are using
objects for creating memory than static?
2. In Java FlowLayout is used in Aplets to organize components. Which
method is used for Applications.
3. How can I show my text in the status Bar in Applet and how can i
get the status Bar.
Thanks,
Sudha.
Sameer - 15 Mar 2005 19:55 GMT
1. A static method is always associated with the class i.e. we do not
need to create objects of the class to use the static methods. The
static methods are called using the general syntax:
ClassName.StaticMethodName.
Note that there is no instance name.
The examples of static methods can be found in the Java API. Some of
them are..
Math.abs, Math.cos etc.-
Usually static methods are general purpose methods related to the
class.
Are you still confused about static keyword?
2.If you are using Frame then the default layout is BorderLayout. Just
use the method setLayout to apply different layouts. You may use
different layouts depending on your need.
3. Use showStatus(String) method of Applet class. A brief description
is given below.
public void showStatus(String msg)
Requests that the argument string be displayed in the "status window".
Many browsers and applet viewers provide such a window, where the
application can inform users of its current state.
Parameters:
msg - a string to display in the status window.
-sameer75@g