This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!

Shashi Kanta

Ranch Hand
+ Follow
since May 08, 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 Shashi Kanta

Hi Pradeep,
Do you mean, struts cannot do that, and is meant for writing session data only?
Please clarify a little more in details..
Thanks,
Shashi
15 years ago
Hi,
I am a newbie to struts, but of late I am seeing that it is gaining so much importance, that everyone is talking about it.
And, as a result of that, companies are mentioning it in the required skill sets for recruitment adverisemnts.
When I just grazed through struts, I found that it uses MVC architecture.
What is confusing me is EJB does just that, and then why struts?
Is it because, it's smaller? What are the advantages it has over EJB?
TIA,
Shashi
15 years ago
oops! the message got truncated.
here it is again.
remove the main method from the calcg class, and put in a JApplet subclass.
Also, create the instance of the calcg class in the init() method of the JApplet.
e.g.
public class CalJApplet extends JApplet{

public void init(){
//create the instance of calcg
}
public static void main(String args[]){
//create the instance of calcg
}
}
-Shashi
15 years ago
Remove the main method from your current class i.e. calcg and put it in a JApplet class
Have a JApplet class
[code]
public class CalJApplet exten
15 years ago
Remove the main method from your current class i.e. calcg and put it in a JApplet class
Have a JApplet class
[code]
public class CalJApplet exten
15 years ago
Hi ,
I have seen that most of the work arounds given to come out of this problem is to use threads.
I tried, but not able to interrupt the main thread.
Here is a snippet of my code.

How can this be implemented in the side thread? Or is there a different solution altogether so that URLConnection.getInputStream() does not get blocked?
Thanks,
-Shashi
15 years ago
Hi,
I am trying to access an HTTP url and get the file size and type of the url resource.
Using URLConnection.getContentType() works fine for all IE platforms, but when Java Plugin 1.3x is installed it this method returns null.
has anyone faced this problem? If so, could you provide a solution for this?
Thanks,
Shashi
15 years ago
Hi,
Use java.util.zip.ZipInputStream for unzipping the zip file, and use ZipInputStream.getNextEntry() to get the ZipEntry object representing each file in the zip file. From the ZipEntry object you can get the name of the file inside the .zip file.
-Shashi
15 years ago
Hi,
I need to access a protected url and get it's resources through an Applet. I am able to do that using IE and NS 7.x.
But, I face a problem in NS 4.7x.
I pass the user credentials through the well known steps,

In Netscape 4.7x, after this step, it hangs. I'm not able to get the InputSream. If I get, I get the redirection html file.
What went wrong here?
Then, I passed the username and password in the url itself, like this:
http://username assword@abcdefg.com/myFile.zip
This works fine in NS 4.7x now. But, the problem is I get the HTTP authentication dialog, which I don't want.
Can someone please tell me how to suppress the dialog in NS 4.7x?
Thanks in advance,
-Shashikanta
16 years ago
Hi,
You need to sign your applet to do that. For testing purpose you can self sign your applet (jar) using Sun's jarsigner utility.
-Shashikanta
16 years ago
Ya, u need to have a look at some books describing common algorithms. Also u need to have a look at Data Structures. If u can study Design Patterns too, then u'll master any programming language!
Shashi
16 years ago
Hi
Hi Divya,
Use the class FileDialog which is there in the awt package.
Thats all !
Shashi
16 years ago
uc = (HttpURLConnection)u.openConnection();
I hope uc above is an URLConnection object.
if so change the code to:
uc = u.openConnection(); //no need to type cast
and remove the lines after this line including uc.setRequestProperty()
these lines are needed in case of POST method, in your case, it is GET method.

Shashi
16 years ago
Hi Alex,
As for making your JComboBox listen to events, you can add an ItemListener to it.
And as for finding out if the vector has changed it's size, you can check the size of the vector, in the ItemStateChanged() method, using Vector class's method size() which will return the number of elements currently in the vector.
I hope that's the question you asked!
Shashi
16 years ago
Hi Bindu,
JTextField doesn't have a similar method like setEchoChar().
But javax.swing provides a component JPasswordField for passwords field.
The default character displayed for whatever you type is '*'. If you want to change that, you can use setEchoChar(char c) method.
So, use JPasswordField for password fields.
Shashi
16 years ago