This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!

PMP Kannan

Greenhorn
+ Follow
since Jan 23, 2003
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 PMP Kannan

Hi,
you can try "Pure JSP" by James Goowill .
it's an excellent book, very concise and u will learn all the funda's there
happy reading
cheers
kannan
18 years ago
JSP
Hello Nathan ,
thank u so much for the timely help. it's exactly what i wanted.
thanks again
i have changed my name as u have instructed. actually my name is very long. so i have shortened it.
it's actually "Palipalayam Muthusamy Palanisamy Kannan"
so i have shortened it to PMP Kannan
is it ok with the naming policy

Cheers
kannan
18 years ago
hi,
i am trying to get multiple views of a Jpanel ( which has some components like label , textfield etc.,)which is added to a JFrame. i tried using cloning technique and i got the clonable part of the JPanel but the cloned part is not editable. it's locked. could anyone tell me how a component can be viewed in multiple editors at the same time and changes made in one editor will be reflected in all editors. Each view is identical to the others.
( for example in NETBEANS IDE we have this functionality) in the java editor of NetBeans IDE if we click clone view u get a new frame with the same contents and changes made in the cloned view is reflected in the main editor and vice versa.
some one pls do help me.( urgent)
thanks in advance
the code i tried to use using clonable interface is given below.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class CloneFrame extends JFrame implements ActionListener {
CloneTest cloneTest = null;
CloneTest cloneTes = null;
JButton button = null;
public CloneFrame() {
cloneTest = new CloneTest();
button = new JButton("Save");
this.getContentPane().setLayout(new BorderLayout());
this.getContentPane().add(cloneTest, "Center");
this.getContentPane().add(button, "South");
button.addActionListener( this );

this.setSize(200,200);
this.setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
CloneTest cl2 = (CloneTest)cloneTest.clone();
JFrame frm2 = new JFrame();
frm2.getContentPane().setLayout( new BorderLayout() );
frm2.setSize(100,30);
frm2.getContentPane().add(cl2, "North");
frm2.setVisible(true);
}
public static void main(String ar[]) {
new CloneFrame();
}
}
class CloneTest extends JPanel implements Cloneable {
JButton jb;
JTextField jt;
public CloneTest() {
jb = new JButton("hello");
jt = new JTextField("hello world");
add(jb);
add(jt);
}

public Object clone() {
try {
return super.clone();
}
catch (CloneNotSupportedException e) {
throw new InternalError(e.toString());
}
}
}

cheers
Kannan

A wise man is one who forgets the faults of others, but always remembers his own

18 years ago
hi Priya,
if u could give the full code to me, i will check it up and tell u where u went wrong. actually i have done a audio conference application and it works fine.

cheers
kannan

Working together works

18 years ago
hello kayla,
struts is simply a framework which defines a model, view , controller design.
for example u can use a servlet to control the actions, java bean for the business logic and jsp jus for presentation.
i got some tutorials, if u'd like them mail me
cheer's
kannan
18 years ago
JSP
hi everyone,
does any one have an idea of how to monitor network traffic using java. apart from traffic monitoring i would like to find out the bandwidth of the internet that a system is connected(is it possible in java)
thanks in advance
cheers
Kannan

Nothing dies faster than a new idea in a closed mind

18 years ago
hello Krishna,
first u should have a DTD for the XML document
let's assume that u have a xml file named Item.xml which has some elements and a DTD file named Item.dtd.
then u should ceate the XML binding schema for the xml doc.
ex:
<xml-java-binding-schema version="1.0ea">
<element name="item" type="class" root="true" />
</xml-java-binding-schema>
save this as filename.xjs
in the above file the element name is item which is the root element.
then generate java files using the schema compiler.
before all this u should set the classpath pointing to ur jaxb jar file.
now compile to generate java files.
suppose the DTD name is Item.dtd and schema name is Item.xjs, then the compilation will be
java com.sun.tools.xjc.Main "Item.dtd" "Item.xjs"
after this java files are generated.
u will get a java file named Item.java which has methods to manipulate the xml data
u can Unmarshall it like this(from XML to JAVA)

Item item = new Item();
File sItem = null;
try {
sItem= new File("Item.xml");
fileInputStream = new FileInputStream(sItem);
item = item.unmarshal(fileInputStream);
catch(Exception e){}
// do the next step to see the xml file printed in the console
System.out.println(item.toString());// will print the xml Doc as a string

u can marshall it back like this(from JAVA to XML)

Item item = new Item();
FileOutputStream fileOutputStream = null;
try{
File changedItem = new File("NewItem.xml");
fileOutputStream = new FileOutputStream(changedItem);
item.marshal(fileOutputStream);
} catch (IOException e){
e.printStackTrace();
} finally {
fileOutputStream.close();

check the file written in the directory. it will be a xml file
that's it
cheer's
kannan

In the country of the blind, one eye'd man is the king

18 years ago
Hi Priya,
You should use javax.sound.sampled package to record and palyback.
actually this package does not provide any facilities for transmitting sound, but it does give u the API's for capture and play back.
as far as transmitting is concerned u should use sockets to transmit and receive.
If u would like more details do contact
cheers
kannan

In the country of the blind, one eye'd man is the king

18 years ago
Hi Cindy,
thanks for the reply.
i think we dont have a section for java sound in javaranch. may be u could do something about that.
What i am doing is a collaboration project, which has video conferencing, white board, chat, slide presentation and many other features. we do have audio conferencing too but it works very well in a LAN environment and in internet too it works fine, only thing is that there is some delay and some noise along with sound.
i am sure some one can help me with jitter (to reduce delay) and noise reduction algorithms.
thanks in advance
Cheers
Kannan
18 years ago
hi,
i have done audio conferencing using java sound and java sockets. but the problem is it's working very well in LAN. but if i use it in internet the voice quality is lost and noise is added. can anyone help me with this.(may be with DSP algorithm and some utilities classes for speeding up the transmission process)
the audio format i am using is
new AudioFormat
(
//Encoding
AudioFormat.Encoding.PCM_SIGNED,

//Sample rate
8000f,

//Sample size in bytes
8,

//Number of channels
1,

//Frame size
1,

//Frame rate
8000f,

//Big endian
true
);
i tried converting the above format to alaw and send it over the n/w. but it didn't work. can anyone tell me whether any other format can be used
thanks in advance
kannan
18 years ago