Riddhi Shah

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

Recent posts by Riddhi Shah

You might want to try our the following code. You can create a mimebodypart object for attachment and then attach it to the multipartbody.
String fileName = "your filename";
MimeBodyPart attachmentPart=new MimeBodyPart();
MimeBodyPart mBodyPart = new MimeBodyPart();
mBodyPart.setContent(multipartBody);
attachmentPart=new MimeBodyPart();
DataSource dataSource = new FileDataSource(fileName);
attachmentPart.setDataHandler(new DataHandler(dataSource));
attachmentPart.setFileName(fileName);
multipartBody.addBodyPart(attachmentPart);
Hope this helps.
20 years ago
I want to know if there is a way to hyperlink a shared file which is on a server and add it in the body of message rather than sending that whole file as an attachment. So that when the recipeint receives the e-mail, he/she can just click on the link and that particular file will open.
I hope my question is clear enough. I need your expert opinion in this matter. Is this do-able or am I crazy?
20 years ago
I did a little more research and I learnt that for Windows 2000,XP and NT OS, there is a command "net view /domain" that will list all the workgroups. However, Windows 98 and 95 does not seem to have these commands.
Now, I guess I am just looking for a similar command in Windows 98 and 95 that would help me figure out the workgroups in "entire network".
Please help.
Thanks,
Riddhi.
I hope this is the right forum to post the following query that I have in the project I am working on.
I have a need to find out all the workgroups existing in a network. I mean, if we go to "Network Neighbourhood"-->"Entire Network", we are able to view all the workgroups in the whole network. How can I get the names of these workgroups and names of all the machines in each workgroups using Java? Is there any Windows OS command for the same?
I tried "net view" commands of Windows. I used the output of this command in the java program. However, net view command only gives the names of all the machines in the same workgroup.
To summerize, if there are 2 workgroups in network - say workgroup1 and workgroup2, I need to know the names of these two workgroups and all the machines available in each workgroup.
I am not too aware of the networking concepts. I hope I am clear with the query.
I need some expert guidance to get this moving.
Thanks,
Riddhi.
I wish I had that much of common sense.
You are right. I used the thread and it worked. There was nothing wrong with the"net view" command.
Thanks for all the inputs.
21 years ago
I am sorry in taking time to get back to you all.
I tried using the "net view" command from the command prompt of Windows 98 machine and it gives me all the names of the machines connected to the network.
I really dont understand where I am going wrong.
Please help.
Thanks,
Riddhi.
21 years ago
Hi,
I am not sure if this is the right forum to post this query. However, I really need some expert guidance.
I had done little research for: How to find out the name of the computers that are connected in your network. I was successful in solving this issue. I was able to find those names using :
Process process = Runtime.getRuntime().exec("net view");
After running this command, I use the getInputStream() to extract those name and then I display them.
This works fine on the Windows 2000 Pro. machine. However, when I try to run the same thing on Windows 98, the system seems to hang. I think thats because the output of process.exitValue() is not equal to 0. Is there a different command that I should run for different OS?
I mean is there a different way to launch "net view" command in Windows 98 than in Windows 2000 Pro using Runtime?
I am really confused. Please help.
For everyone's reference, the code that I use is as follows:
StringBuffer strBuffer= new StringBuffer();
String line= null;
try
{
Process process = Runtime.getRuntime().exec("net view");
BufferedReader b = new BufferedReader(new
InputStreamReader(process.getInputStream()));
PrintWriter to= new PrintWriter(process.getOutputStream());
to.close();
try
{
// we need the process to end, else we'll get an
// illegal Thread State Exception
line= b.readLine();
while (line != null)
{
strBuffer.append(line+"\n");
line= b.readLine();
}
process.waitFor();
}
catch (InterruptedException inte)
{
System.out.println("InterruptedException Caught");
}
if (process.exitValue() == 0)
{
System.out.println(strBuffer.toString());
}
process.destroy();
}catch (IOException ioe)
{
System.out.println( "IO Exception Occured While Messing aruond with Processes! -> " + ioe);
}
Thanks,
Riddhi.
21 years ago
Hi,
I have a JDialog with a customized look and feel. I have set the title of the titlebar using:
dialog.setTitle("My Dialog");
I want to set the font size of "My" as 10 and font size of "Dialog" as 8. How can I achieve this? Is this do-able or I am thinking crazy.
I tried using UIManager.put method. But it sets the font size globally.
Please help.
Riddhi.
21 years ago
I tried using JPadel. However, it just had one jar file and I am not sure what else do I do afer including that jar file in my classpath.
It would be a great help if someone can guide me in the right directions.
Thanks,
Riddhi.
21 years ago
I want to display a pdf file (which is converted from an image) on a pdf writer so that I can copy this file for the later use.
Actually, my aim is to copy a pdf file and then paste it on another pdf file.
My application is like an electronic post-it notes that can be copied and pasted on any other applications like MS Word, Excel, Outlook etc. Now, we are trying to copy and paste our 'Note' on the pdf document. As we all know Acrobat reader will not allow to copy or manipulate the document, so we are trying to create a pdf document out of an image and then paste it over another pdf file.
I have so far been successful in creating pdf document out of an image. Now, I want to display it and copy it through Java application, so that it can be pasted on any other pdf file.
Is this do-able or am I crazy to think of such things?
I need some help with this. I would be greatful if someone can share some experience in this matter with me.
Thanks,
Riddhi.
21 years ago
Hi,
I am sure this question might have raised many times.
I have a requirement in my project to convert an image into a pdf file and after converting, display that file using some pdf writer. I was successful in creating a pdf file from an image using iText, PDFLib etc. However, the common issue with these code is that after creating the pdf file, this file gets saved in my 'classes' folder. So if I want to display this file, I have to use Runtime.exec() method to open this file using Adobe acrobat writer.
I am looking for some API that would open this generated pdf file from the code itself(other than runtime.exec()). Is this thing do-able. Are there any APIs that help me do this?
I hope I make some sense to you guys.
Thanks.
21 years ago
Hi,
I am not sure this is the correct forum to post my query.
Query is related to Networking and I/O.
I have a need to send an image from one computer to another using Java.
This image should be displayed right on the receipient's desktop.
We know that if we type "net send "computer_name" "message" in Start-->Run, the "message" is displayed on the machine-computer_name", which is connected to your machine.
I need the same kind of functionality for image. I need to send an image to another computer and display it on the receipient's desktop.
I think to pass an image, I will have to convert the image to byte array and then on the receipent's end convert the byte array to image.
I am not sure how to code this. I might sound quite ignorant. I mean how do I code this logic?
I need some guidance.
Thanks.
Thank you for all your help.
I am using JDK 1.4.0_03 - for dragging and dropping an image in my application. I think this functionality is not a part of JDK1.3.
My question is:
1) How can I incorporate JavaBean Bridge for Active X Contorl in my java code (in my application?).
2) Is it true that a person who wants to achieve this functionality(drag and drop textbox from application) should have this bridge installed on his machine? I mean is it true that the end-user has to have this bridge installed on his machine inorder to use this application?
It would be a great help if you could get back with me.
Looking forward to recieving your reply.
21 years ago
Nathan,
I really appreciate your help. It has given me some direction to do some more research.
I also wanted to let you know that we are using JDK1.4.0_03. The article says that the bridge has worked till JDK1.3.1 and will work from JDK1.4.2. I was just curious to know if this would work for JDK 1.4.0_03.
I will do some more research on this. But as I had also told earlier, I will get back to you for more help.
Thanks again, I really appreciate your help.
21 years ago