Pratiti Naphade

Ranch Hand
+ Follow
since Mar 13, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pratiti Naphade

thanx for that ashish...just see if u can do something with this code
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class assignment1 extends Applet implements ItemListener
{
private Choice objects;
private DrawingCanvas drawing = new DrawingCanvas();
String msg="*";

public void init()
{

setLayout(new FlowLayout());
add(new Label("Choose an object: "));
objects = new Choice();
objects.add("Circle");
objects.add("Arrow");
objects.add("Square");
add(objects);
objects.addItemListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
boolean b;
msg+="before: inside itemChanged";
repaint();
b=drawing.handleChangeObject(objects.getSelectedItem());
msg+=b;
repaint();
}
public void paint(Graphics g){
g.drawString(msg,40,40);
}

}
class DrawingCanvas extends Canvas
{
String msg2="";
int xpts[]={10,30,20};
int ypts[]={100,100,115};
int num=3;
private int x = 8, y = 18;//circle
private int width = 30, height = 30;//circle
private int x1 = 18, y1 = 50;//arrow
private int width1 = 4, height1 = 50;//arrow

private Color myColor = Color.red;
private String object = "Circle";
public DrawingCanvas()
{
msg2+="Constructor instantiated";
setBackground(Color.green);
}
public void paint(Graphics g)
{
g.drawString(msg2,400,300);

if (object.equals("Circle"))
{
g.fillOval(x,y,width,height);
}
else if (object.equals("Arrow"))
{
g.drawPolygon(xpts,ypts,num);
g.drawRect(x,y,width,height);
}
else if (object.equals("Square"))
{
g.draw3DRect(40,50,10,10,true);
}
}

public boolean handleChangeObject(String s)
{
msg2+="INSIDE HANDLE CHANGE OBJECT";
object = s;
repaint();
return true;

}

}
18 years ago
I need an applet which has 3 buttons on it:
Circle,Triangle,Arrow
when i click on any of these button their corresponding graphic is to be shown on the applet....
WHen i click Circle a circle should appear...and so on...
the prob is if i right ,if case, in actionPerformed()...I cannot cannot possibly say g.draOval(10,101,50,50); since that can be done in paint(Graphics g)....
or do i create user defined componenets....as Circle.java etc etc...and then instantiate the class in such a wway that it gets added on to the applet....
I REALLY DON'T KNOW...PLEAAAAAAAASEW HELP
[ October 13, 2002: Message edited by: Pratiti Naphade ]
18 years ago
i have worked on j2sdkee1.2....and have deployed a simple Session EJB with no hassels.
Now i'm using j2sdkee1.3....while going throughthe EJB wizard ther's one thing i am really confused...
There r twoi distinctive headings:
A)Local Interface:
and in that ur supposed to key in
1)Local Home Interfcae
2)Local Interface
and
B)Remote Interface:
1)Remote Home Interfcae
2)Remote Interface
\I tried all permutaion and combinations od keying in home interface as well as remote interface in these 4 text fields...
But no luck...It gives a problem in deployment...
If anybody's tried it..pls let me know at the earliest..'cos i have to submit a project on monday...
Thanks
. Write a java applet that will allow a user to first upload any file from his local machine to the server, and then be able to view the file he has uploaded.
>
19 years ago
i just downloaded JSDK 2.1..i set the path as c:jsdk2.1
but whenever i rite a code and try to compile the .java file iit says javax.servlet does not exist...
Please HEEEEELP
[This message has been edited by Pratiti Naphade (edited April 14, 2001).]
19 years ago
hi!!
cleared SCJP today....Could u all please help me to decide what should i go in for....What is the difference betwwen SCJD and SCEA...and how do respective exams help .
thank u soo much pankaj....i'm really gettin very tensed...anywas..thanks again
19 years ago
Terific score pankaj!!!i am attempting theexam day after any tips for me???
could u tell me what kind of Q were there....what should i emphasize on?
19 years ago
why doesn't this code give an error>
public satic void main(String a[]){
long m=5;
float f =m;???
float is 32 in size and long is 64bits...
but it still compiles and does not give any error
they are not performed on char...
in the prnt line it is converted to int.
try this
char a = 'a';
char b = 'b';
char c = a& b;//error
why doesn't this code give an error>
long m;
float f =m;???
so sorry gayathri.Even i couldn't make it 4 months back....then the passing was 71% and i got 69%....
try and see what ur weak points were.....do u remeber what kind Q had come so probably u know whwere u lost and improvise...I think basically ifd u clear ur fundas ...things get simpler....
even i am gonna reattempt the exam on the 2 nd April..Lets see what happens....
basically lost all my points in AWT and flow control ...Math..I fooound all those operators very difficult and basicaly i thought i should concentrate more on object oriented concepts..but beleive me all the other packages and operators are extremely important to give u a boost in the exam....
sometimes u score in the area of overridin and stuff but lose on allthis...pls let meknow if i could be of any help...
i surely know how u feelrite now....
take a break...and start all over again!!

[This message has been edited by Pratiti Naphade (edited March 27, 2001).]
19 years ago
JQ+
one of the answers say :Anonymous inner class cannot be static???
static A method(){
return new A{}//what's this???
}
It is not an abstract class...but yes its constructor is protected.