murugesan subramani

Greenhorn
+ Follow
since Jul 02, 2001
Merit badge: grant badges
For More
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 murugesan subramani

Hi,
I encountered a problem when compiling/executing a java program after i installed JDK1.2.2 in Linux m/c which had the libc version of 2.1.1.Installation went well.But when i issued the command "java" or "javac" in path other than the "JAVA_HOME/bin" i encountered the following error:
"Error : Can't find libjava.so"
Can anyone please mail of the solution to it?
Regards,
muru
22 years ago
Hi Hirdesh,
I did set the classpath properly and also there is the sampClass1.class present.But still it does not work.Can you please mail me of the .jar files to be set in the classpath and any other solution as i've tried everything possible.
Murugesan Subramani

Originally posted by hirdesh:
Please check that the classpath is set properly. Also make sure that sampClass1.class has indeed been created. Hope this helps.
Hirdesh


[This message has been edited by hirdesh (edited September 12, 2001).]


Hi,
I was trying a sample XML Parser program using java with using jaxp1.1 and SAX2.0 software.I created a class "sampClass1" which simply counts the number of specific tags of a input XML file.It clean compiled(no errors/warnings).But when am executing the following is the error message i got
C:\>java sampClass1
Exception in thread "main" java.lang.NoClassDefFoundError: sampClass1
Following is the code.
import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.Locator;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.XMLReader;
import org.xml.sax.InputSource;
//import org.apache.xerces.parsers.SAXParser;
public class sampClass1 extends DefaultHandler
{
private int count = 0;
public static void main(String args[]) throws Exception
{
sampClass1 c1 = new sampClass1();
c1.bookCounter();
}
public void bookCounter() throws Exception
{
XMLReader xmlreader = null;
SAXParserFactory spFactory = SAXParserFactory.newInstance();
spFactory.setValidating(false);
SAXParser spParser = spFactory.newSAXParser();
xmlreader = spParser.getXMLReader();
xmlreader.setContentHandler(this);
InputSource source = new InputSource("samp.xml");
xmlreader.parse(source);
//xmlreader.parse("file:///C:/samp.xml");
}
public void startElement(String name , Attributes atts) throws SAXException
{
if(name.equals("book"))
count++;
}
public void endDocument() throws SAXException
{
System.out.println("There are "+count+" books");
}
}
Please respond.
Thanks and Regards,
Muru.
I have a
class A{
public int var_A;
public void run(){
try(){
doSomething();
Thread.sleep(130);
}catch (InterruptedException e){
}
}
}
public class demo{
private A [] a=new a[10];
public static void main(String [] args){
for(int i=0;i<10;i++){
a[i]=new a();
a[i].start();
}
}
}
now how do change the value of var_A in class A at every 625 milliseconds using a Timer.schedule method?
thanx
I have my own class which creates a Rectangle derived from Rectangle2D. How do add an action listener for this object?
I have also coded the MouseAdapter class but dont know where to add.
See the code
thanks in advance.
********************************************
import java.awt.*;
import java.applet.*;
import java.awt.geom.*;
import java.awt.event.*;
public class BT2 extends Applet implements ActionListener {
Graphics2D g2; // Reference to Graphics2D context
public BTDevice [] Device =new BTDevice[10];
private int x,y;
public BT2() {} // Construct the applet
public void init() {
addActionListener(this);
}
public void paint(Graphics g){
g2 =(Graphics2D) g;
for(int i=0;i<10;i++){
x = (int)(Math.random()*getSize().height+10);
y = (int)(Math.random()*getSize().width+10);
Device[i] = new BTDevice(x+5,y+10,25,25,i,g2);
}
BasicStroke s1 = new BasicStroke(2);
g2.setColor(Color.red);
g2.setStroke(s1); // Tell the graphics context about it
for(int j=0;j<10;j++){
g2.draw(Device[j]);
}
}
public void actionPerformed(ActionEvent e){
}
}
class BTDevice extends Rectangle2D.Double implements ActionListener{
private int widht;
private int height;
private int px;
private int py;
private byte[] BD_ADDR;
public BTDevice(){
}
public BTDevice(int a,int b,int c,int d,int dno,Graphics2D g){
super(a,b,c,d);
g.drawString("D"+dno,a,b);
BD_ADDR = new byte[8];
}

}
class DeviceListener extends MouseAdapter {
private final int radius = 25;
public PopupMenu deviceMenu;
public void mousePressed(MouseEvent event) {
deviceMenu = new PopupMenu();
MenuItem page = new MenuItem("Page");
deviceMenu.add(page);
}
}
22 years ago
Actually I need to implement what I said, how
this can be done? is my question.

[This message has been edited by murugesan subramani (edited July 10, 2001).]
thank you very much, that was helpful a lot!
I need to display few(more than) Rectangle/Rectangle2D objects on an applet at any position, ie without following any particular layout manager. I need to implement the rectangle by using my own class, with some additonal functionalities(actionListeners for mouseclick etc). This is for my thesis work, the rectangle boxes are actually Bluetooth devices.
Thanks
hello! some one help me!
22 years ago
I need to create my own object(like rectangle), should be able to
display 10(more than one) of these objects in random anywhere in the applet and they should be able to respond to events(like mousePressed). How to create the object and where to call (in paint?).
muru
22 years ago