Dev Prakash

+ Follow
since Oct 09, 2000
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dev Prakash

Hi lakshmi,
I guess in your code the method "theInstance" should be static, so that other class can you this class to create the new instance or use the available instance.
- dev Prakash
-Dev Prakash
Hi Vikram, Congrtats!!!
Please send me also some experience and tips!!!
-Dev Prakash
Congrats!!! Vivek....
- Dev Prakash
Congrats!!! 100% Great Score...
Please send me notes at
- Dev Prakash
21 years ago
Congratulations !!!
Geat passing, 72% is a good score and it does not matter as long as you have learned java.
-Dev Prakash
Congrats!!! Wilbin
That's really a great score.
-Dev Prakash
Thanks Prasanth Tata,
This solutions works, but I wanted to just work with AWT Components and not Swing.
I can attach a panel to applet and scrollpane to panel and all other components to scrollpane. And it works fine, BUT I wanna know if we can directly attach scroll bar to applet.
-Dev Prakash
21 years ago
Yes!!! Correct Answer is B, It will create runtime error as browser JVM does not find any public no-arg constructor for the applet.
It do you do not specifically put any constructor, compiler will put one public no-arg constructor. BUT you provide your own compiler will not put any.
In this example, you have provided the constructor like this;
public Sample (String string) {
text = string;
So compiler did not put any and at runtime it failed as browser's JVM did'nt find any public no-arg constructor for the Applet.
I guess, you have the point clear now.
- Dev Prakash
How can ScrollBar be Attached to Containers like Applet, frame etc.
I have a big user registration Applet and I want to make it small size and attach the scroll bar so that users can scroll and fill up the data. Please help me,How can I acieve this?
- Dev Prakash
21 years ago
Hi All,
I found the answers of my questions from the SUN's Artical about event handling, I am just posting it here so that all who care can be benifited.
Ajith, My doubt was valid, the New version of Java does not Just support "producer-subscriber" model but support both, here is how:

Compatibility with the old Model
Our intention is to maintain binary compatibility for programs written to the old model for the 1.1 release. However, we strongly recommend new java programs
migrate to the new model. We do not encourage the explicit mixing of the two models within a single Applet. However, we realize that programs which
code to the new model may need/wish to use existing GUI classes which still use the old model and so we have done our best to ensure this works (for
example, the hotjava browser is a java application which will need to be able to load both 1.0 and 1.1 style applets).
The way this works is that the AWT will recognize a component as being either a 1.0-event-model "target" OR a 1.1-event-model "source", but not both. A
component is recognized to be a 1.1-event-model "source" by meeting one of the following conditions:
1.A listener (of any kind) is registered
2.An event type (of any kind) was explicitly enabled by calling enableEvents()
ELSE the component will be treated as a 1.0-event-model "target" and all events will be delivered to the 1.0 handleEvent method as before.
Note that this is an "all or nothing" distinction and that once the AWT determines a component is a particular event model type, ALL events on that component
will be processed in that context. For example, if a TextField object has only a FocusListener registered, then only focus events will be dispatched to the
textfield in the 1.1 mechanism and the old 1.0 handleEvent method will NEVER be called (not even for other event types!). So while it is possible to combine
components which use the different models, it is not possible to get a single component to mix both models.
One key difference between the two models is that the old model would automatically propagate events up the containment hierarchy, while the new model
does NOT propagate events in this way. The way this works for compatibility is that if an event originates on a component which is a 1.0-event-model "target",
then it WILL be propagated up the hierarchy in the 1.0 fashion, regardless of the event model type of its ancestor containers. If an event originates on a
1.1-event-model "source", then that event will NOT propagate up the hierarchy, regardless of the event model type of its ancestor containers.
I have created an Applet without any layout and it is very big in size and on the browser i have less space, so i wanna attach a scrollbar to the applet. Can Anybody Suggest what kind of code i have to write to let the applet scroll?
I tried SrollPane but that takes only one component.
-Dev Prakash
21 years ago