pilania

Greenhorn
+ Follow
since Mar 20, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by pilania

Classes12.zip belongs in Tomcat-root/common/lib. Restart the server and it should be okay.
22 years ago
I think you should have a form-bean defined. wherein form-bean will have logic to get data from database and populate html.
22 years ago
one way is if you have loggin mechanism or when user hits your server keep a hashtable/dbtable of each user session. So depending on number of entires in your hashtable/dbtable at any time you can find out how many users are surfing the net.
23 years ago
This might help. This is the code for playing audio from Application and not from Applet.
import java.applet.AudioClip;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.awt.GridBagLayout;
public class SoundApplication extends JPanel
implements ActionListener,
ItemListener {
SoundList soundList;
String auFile = "spacemusic.au";
String aiffFile = "flute+hrn+mrmba.aif";
String midiFile = "trippygaia1.mid";
String rmfFile = "jungle.rmf";
String wavFile = "bottle-open.wav";
String chosenFile;

AudioClip onceClip, loopClip;
URL codeBase;
JComboBox formats;
JButton playButton, loopButton, stopButton;
JLabel status;

boolean looping = false;
public SoundApplication() {
String [] fileTypes = {auFile,
aiffFile,
midiFile,
rmfFile,
wavFile};
formats = new JComboBox(fileTypes);
formats.setSelectedIndex(0);
chosenFile = (String)formats.getSelectedItem();
formats.addItemListener(this);
playButton = new JButton("Play");
playButton.addActionListener(this);
loopButton = new JButton("Loop");
loopButton.addActionListener(this);
stopButton = new JButton("Stop");
stopButton.addActionListener(this);
stopButton.setEnabled(false);

status = new JLabel(
"Click Play or Loop to play the selected sound file.");

JPanel controlPanel = new JPanel();
controlPanel.add(formats);
controlPanel.add(playButton);
controlPanel.add(loopButton);
controlPanel.add(stopButton);

JPanel statusPanel = new JPanel();
statusPanel.add(status);

add(controlPanel);
add(statusPanel);
startLoadingSounds();
}
public void itemStateChanged(ItemEvent e){
chosenFile = (String)formats.getSelectedItem();
soundList.startLoading(chosenFile);
}
void startLoadingSounds() {
//Start asynchronous sound loading.
try {
codeBase = new URL("file:" + System.getProperty("user.dir") + "/");
} catch (MalformedURLException e) {
System.err.println(e.getMessage());
}
soundList = new SoundList(codeBase);
soundList.startLoading(auFile);
soundList.startLoading(aiffFile);
soundList.startLoading(midiFile);
soundList.startLoading(rmfFile);
soundList.startLoading(wavFile);
}
public void stop() {
onceClip.stop(); //Cut short the one-time sound.
if (looping) {
loopClip.stop(); //Stop the sound loop.
}
}
public void start() {
if (looping) {
loopClip.loop(); //Restart the sound loop.
}
}
public void actionPerformed(ActionEvent event) {
//PLAY BUTTON
Object source = event.getSource();
if (source == playButton) {
//Try to get the AudioClip.
onceClip = soundList.getClip(chosenFile);
stopButton.setEnabled(true);
onceClip.play(); //Play it once.
status.setText("Playing sound " + chosenFile + ".");
if (onceClip == null) {
status.setText("Sound " + chosenFile + " not loaded yet.");
}
return;
}
//START LOOP BUTTON
if (source == loopButton) {
loopClip = soundList.getClip(chosenFile);
looping = true;
loopClip.loop(); //Start the sound loop.
loopButton.setEnabled(false); //Disable start button.
stopButton.setEnabled(true);
status.setText("Playing sound " + chosenFile + " continuously.");
if (loopClip == null) {
status.setText("Sound " + chosenFile + " not loaded yet.");
}
return;
}
//STOP LOOP BUTTON
if (source == stopButton) {
if (looping) {
looping = false;
loopClip.stop(); //Stop the sound loop.
loopButton.setEnabled(true); //Enable start button.
} else if (onceClip != null) {
onceClip.stop();
}
stopButton.setEnabled(false);
status.setText("Stopped playing " + chosenFile + ".");
return;
}
}
public static void main(String s[]) {
WindowListener l = new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
};
JFrame f = new JFrame("SoundApplication");
f.addWindowListener(l);
f.getContentPane().add(new SoundApplication());
f.setSize(new Dimension(400,100));
f.show();
}
}
Did not have time to convert your program to this specs. Please note that your program is far simpler than this.
hope this helps!!

23 years ago
Please disregard the last message. Just wanted to make sure that my older id still works. Haven't posted on this board for a long time.
Now to answer your question regarding parsers and stylesheets. Here are my 2 cents.
1. Parser: when data is embedded in user defined XML tags there must be mechanism to get the data out of the xml document. Parser (usually) java program does that for you. There are two types of parser SAX/DOM...... and it goes on and on and on and on. Reading a book or going to www.w3schools.com/xml has good tutorial to get you started on that.
2 Stylesheets comes into the picture when we talk about presentation the the data in XML doc. You can very well use CSS or better still XSL. Once again Reading a book or going to www.w3schools.com/xml has good tutorial to get you started on that.
hope this helps
it would help us in understanding your problem better if you will please print the whole exception message.
also explain your environment. like what version of JDK u are using
also which web server u are using.
i am no guru but still i will try to explain why is it the way it is
first of all EJB works the same way as RMI.
by using jndi service and looking up home interface makes the object location transparent to user/client. that means the object may very well be on your machine or it may well be on a networked machine 1000s of miles aways, making it the "Enterprise" bean in true sense of the word.
hope it helps
:
Rohit
When programming people with lot of programming experience have found that usually there are some snippets of code which is quite often repeated most of the time so they have taken em generalized piece of code and kept it aside and that becomes "Design pattern" for that particular type of code.
You can learn more about design patterns by reading "Desing Patterns"
you can think of design patterns as pearl of wisdom from you elders so that you do not go about reinventing the wheel.
Hope it helps.
PS: you can e-mail me at pilania@netzero.net and i can even send you a free digital book named "design patterns" by James W. cooper.
This might help
Go to the site www.TheServerSide.com and click on Resources to download free copy of the book by Ed Roman. Excellent Book but you cannot print it.
SCJP certainly helps. But as for getting job in US, I doubt it if you will get a good paying job. I suggest you do SCJP and then get at least 1 yrs expereince in india working on EJB, Servlets, RMI/CORBA, JNDI etc.
Coz Java in isolation does not carry much clout, its the expanded technology on top of Java like EJb which pays up big time.
24 years ago
Milind
I appreciate your suggestions/thoughts. But the problem is fixed. Here is how
I have J2sdkee1.2.1 installed on my machine. It needs that you put couple of J2EE jar files in
root(C: or d /jdk1.2.2 (or jdk1.3)/jre/lib/ext. I removed them files and voila.
Ofcourse your suggestion about putting my work directory in the classpath was what finally did it.
\\// Live Long and Prosper
24 years ago
Milind
I do not have d:\xml is classpath bit it is in my path. I have d:\jdk1.3\lib only in my classpath.
And i do have rmi directory its strucutre is d:\xml\rmi and al three class files are in there too.
For all its worth even if i enter rmic and press enter it gives me the same error.
24 years ago