Chaitanya Reddy

Greenhorn
+ Follow
since Jun 06, 2002
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 Chaitanya Reddy

Hello
I used EMBED tag for NETSCAPE 4.7 and NETSCAPE 7.It didn't work for both the versions.
For NETSCAPE4.7 , it says "JavaBeans notinited" and
for netscape 7, it says "Click here for plugin" ,but plugin has already been installed.
My code is as follows :
<HTML>
<HEAD>
<TITLE>A Simple Program</TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>
</APPLET>
<br>
<br>
<br>
<object codetype="application/java" classid="java:HelloWorld.class" width="150" height="500">
Java applet
</object>
<br>
<br>
<embed src="HelloWorld.class" height ="150" width="150"></embed>
</BODY>
</HTML>
When I opened the page using netscape 7, applets appeared for <APPLET> ,<OBJECT> but didn't work for EMBED .
What is the reason?
Please help me
thanks
chaitu
17 years ago
Hello..
I have written an HTML file that uses OBJECT tag to include applets.But OBJECT tag didn't work in IE 6 but <APPLET>tag worked . Also I wrote EMBED tag for netscape.It says Java beans not inited.What does this mean?
Please help me as soon as possible
thanks
chaitu
17 years ago
Thanks..
It worked..

regards
chaitu
17 years ago
Hello,
This is the code for my applet.Please tell me the changes for efficiency.
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.net.*;
//<applet code="Pro" width=900 height=200 ></applet>
public class Pro extends Applet implements ActionListener,MouseMotionListener
{
Button jb1,jb2;
int rect1s=-1,rect1e=-1,rect2s=-1,rect2e=-1,ovals=-1,ovale=-1;
String upstream=new String("");
String downstream=new String("");
int mouseX=0,mouseY=0,x,m;
TextField tf=new TextField(20);
public void init()
{
setBackground(Color.white);
addMouseMotionListener(this);
}
public void start()
{
System.out.println("Hey it started");
}
public void paint(Graphics g)
{
rect1s=900;
rect1e=950;
rect2s=2500;
rect2e=3000;
ovals=1500;
ovale=1800;
upstream="29389";
downstream="45466";
jb1=new Button(upstream);
jb2=new Button(downstream);
x=250+(int)(500*(ovals-rect1e)/(rect2s-rect1e));
m=(int)(500*(ovale-ovals)/(rect2s-rect1e));
g.setColor(Color.magenta);
jb1.setBounds(10,100,100,30);
jb1.setBackground(Color.orange);
jb1.setForeground(Color.black);
jb1.addActionListener(this);
add(jb1);
jb2.setBounds(700,100,100,30);
jb2.setBackground(Color.orange);
jb2.setForeground(Color.black);
jb2.addActionListener(this);
add(jb2);
g.setColor(Color.pink);
g.drawLine(100,125,700,125);
g.setColor(Color.green);
g.fillOval(x-40,100,m,50);
tf.setBounds(20,20,100,20);
add(tf);
g.setColor(Color.black);
g.drawString("UPSTREAM ",30,170);
g.drawString(""+(int)ovals,x-40,170);
g.drawString(""+(int)ovale,x+m-40,170);
g.drawString("DOWNSTREAM",710,170);
g.drawString(String.valueOf(ovals-rect1e)+"bp",(200+x)/2,150);
g.drawString(String.valueOf(rect2s-ovale)+"bp",x+m+50,150);
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==jb1)
{
try
{

AppletContext ac=getAppletContext();
ac.showDocument(new URL("http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?cmd=Retrieve&db=protein&list_uids="+upstream));
}catch(Exception xe){}
}
if(e.getSource()==jb2)
{
try
{
AppletContext ac=getAppletContext();
ac.showDocument(new URL("http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?cmd=Retrieve&db=protein&list_uids="+downstream));
}catch(Exception xe){}
}
}
public void mouseMoved(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
if((mouseX>=(x-40))&&(mouseX<=500))
tf.setText("yes u got it");
else
tf.setText("");
}
public void mouseDragged(MouseEvent me){}
}
If u don't understand the code,please let me know.

thanks
chaitu
17 years ago
Could u please describe more in detail about how to go about it.

Thanks
chaitu
17 years ago
Thanks Mr.Ernest Friedman-Hill ,it worked.
My applets are to be loaded online.But there is a refresh problem with my applets.If I maximize the webpage having my applets,the content of my applet is getting changed.
What should I do to avoid such problems??
Please reply me
thanks
chaitu
17 years ago
Hello ..
My applets run in IE but not in netscape.What should I do to make them work in netscape..
thanks
chaitu
17 years ago
I am not using J++.Should I download java plugin for netscape??

thanks
chaitu
17 years ago
hello everyone..
Is there a method to link to an URL when we click on applets?
i.e I wrote an applet drawn with two rectangles.My idea is to link to an URL when I click on one of the rectangles.
Can I do this??If so,how can I do this?
please help me.
thanks
chaitu
17 years ago
Mr.Chakrabarty..
I tried calling applets by creating the folder MyApplets.But my problem remains the same.Could u suggest another method to do this??
thanks
chaitu
17 years ago
Hello everyone..........
I am trying to generate applets from Tomcat.I have JRE in my system........All the class files are store in "C:\Program Files\Apache Group\Tomcat 4.1\webapps\ROOT\WEB-INF\classes" directory.Even my applet class files are stored here.
When I called applet from servlet, "java.lang.ClassNotFound Exception" occured.
Please help me as soon as possible.........
This is very urgent.
thanks
chaitu
17 years ago
Hi,
I'm calling a servlet from another :
pw.println("<tr><td><a target=\"new\" href='/servlet/threedstr?pid='fromdata'&spos='spos'&epos='epos'&cmd=5'> 3D Structure</a></td></tr>");
where the parameters pid,spos and epos are to be sent dynamically with the values in the corresponding variables.
But it is giving a runtime error: Number Format Exception.
Can someone tell me if this is the right way to pass values in variables as parameters?
Thanks.
17 years ago
Dear all,
I have problems invoking applets from Netscape Navigator 4.7.I used <APPLET> tag to include the applets in html file.It worked fine in IE 6.But
"Applet BioPro.class ClassFormat Error Bad Major Version Number." raised when executing in netscape.
Does the code differ from IE?
Please reply me.
Thanks
Chaitu.
17 years ago
Hello William Brogden ,
Thanks for your reply.Yeah u r right Mr.Brogden.I missed out few statements while I was copying from my program.
I will try out your method.
Thanks anyway.
Chaitu
17 years ago
Hello everyone,
I am trying to connect to URL through the following code.
u=new URL("http://www.rcsb.org/pdb/cgi/explore.cgi?job=download;pdbId=1KIT;page=;pid=8231059904141&opt=show&format=PDB&pre=1";);
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "192.168.36.204");
System.getProperties().put("proxyPort", "80");
u.setDoOutput(true);
u.setUseCaches(true);
theHTML = new DataInputStream(u.openStream());
while ((thisLine = theHTML.readLine()) != null)
{
if(thisLine.startsWith("HELIX"))
{
sb=thisLine;
System.out.println(thisLine);
while ((thisLine = theHTML.readLine())!=null)
{
System.out.println(thisLine);
if(thisLine.startsWith("MASTER"))
{
break;
}
else
{
sb=sb+"\n"+thisLine;
}
}
}
}
It successfully gets connected to the specified URL.But after printing a few lines on to the screen,the program stops by invoking "java.net.SocketException" .How to handle this exception?

And also is there any more efficient mechanism to connect to URLs other than the above one.If so, please write to me.
Please reply me as soon as possible.
Regards,
Chaitanya Reddy
17 years ago