OPen Notepad using  java

I have a simple java program.
Which containes a string variable str = �hai�.
I opened notepad from this java program.
After the notepad is opened it should contains the text �hai�.
How to do it.?
I did it but nothing is displayed.my code is �..
I opened notepad using : Process p=Runtime.getRuntime().exec(�notepad.exe�);
I obtained an output stream to this subprocess as : p.getOutputStream()
I send it to BufferedOutputStream as : BufferedOutputStream bos=new BufferedOutputStream(p.getOutputStream());
Now I convert the str into bytes and send (write it) to notedpad as : bos.write(str.getBytes());
But it doesnot display anything.
thanks in adv.

if possible please reply. i want to open a
notepad and send some data to notepad thats all the
matter.It might be possible - but you'd be better off asking in a microsoft forum. (or take everyone else's advice and spend the 10 minutes writing a tiny swing app to do this.

Similar Messages

  • Open winamp using java

    hello,
    can i open winamp using java code?
    pls help me,
    thankyou

    http://forum.java.sun.com/thread.jspa?threadID=5234858&messageID=9961637#9961637

  • Open notepad using a servlet

    Does anyone know to open the note pad from servlet application
    i am using IE 5.5

    Sorry, that doesn't make much sense. Your servlet is running on a web server, and having it open Notepad on that server is pointless. Having the servlet send a response to your browser that causes it to open Notepad might be possible, but you'd have to do some configuring of your browser to make that happen. That would make the servlet pretty useless, because anybody who wanted to use it would have to reconfigure their browser in the same way.

  • How to open MSWORD using JAVA/JNI and write the database entries into WORD

    Hi..
    I am searching for java codes that uses JAVA NATIVE INTERFACE (JNI) for opening MSWORD 2003.
    To be brief.
    I created HTML form called Employee_data.
    if i click on Submit button a word document should be opened.This should be using JNI.
    I have also created a servlet in jsp to process the form data and store it into database(mysql).;
    Please help me to find the codes to open MSWORD on submit click and to write the database entries into word file.Can i get the full code for that.This is so urgent.
    Thanks in advance.

    Hi Suresh,
    The easest solution I can think of is to copy the math equation from the PowerPoint then paste in the Word document directly, there's actually no way to convert it to plain text, some equation is very complext, String variable is not suitable in this case.
    For example, this code works fine:
    var powerPoint = new Application { WindowState = PpWindowState.ppWindowMinimized };
    var oPresSet = powerPoint.Presentations;
    Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"C:\test.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
    var strObj = oPres.Slides[1].NotesPage.Shapes[2].TextFrame2.TextRange.MathZones.get_MathZones();
    strObj.Copy();
    Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
    wordApp.Visible = true;
    Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Add();
    doc.Range(0, 0).Paste();
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can i open winamp using java?

    hi frnds,
    i want to know how to open winamp using javacode.......
    Thank u.

    JDIC
    https://jdic.dev.java.net/
    "This incubator project hosts the API to control the native music players, e.g. Winamp, Rhytmbox, iTunes, etc."
    https://jdic.dev.java.net/incubator/mpcontrol/index.html

  • OutOfMemoryError when opening environment using Java API

    I've been getting a strange error recently and I can't seem to figure out why. Whenever my DBXML environment gets opened, I receive a "java.lang.OutOfMemoryError: Cannot allocate memory" error. The machine has over 700 MB of free RAM. Here is the code I use to create/open the environment.
    EnvironmentConfig envConf = new EnvironmentConfig();
    envConf.setAllowCreate(true); // If the environment does not exits, create it.
    envConf.setInitializeCache(true); // Turn on the shared memory region.
    envConf.setInitializeLocking(true); // Turn on the locking subsystem.
    envConf.setInitializeLogging(true); // Turn on the logging subsystem.
    envConf.setTransactional(true); // Turn on the transactional subsystem.
    envConf.setThreaded(true); //Turn on thread-safe
    envConf.setLogRegionSize(500000); //Increase logging region
    envConf.setErrorStream(System.err); //Set error stream
    envConf.setMaxLocks(5000); //Set max # of locks
    envConf.setMaxLockers(5000); //Set max # of lockers
    envConf.setMaxLockObjects(5000); //Set max # of lock objects
    envConf.setMaxMutexes(10);
    //Set the error stream to write to a log file
    String fileName = SystemProps.DATA_HOME + "/dbxml.log";
    File f = new File(fileName);
    FileOutputStream fos = new FileOutputStream(f);
    envConf.setErrorStream(fos);
    return new Environment(envHome, envConf);
    Is there something specific I'm doing here that would require lots of RAM? Could it be related to the size/contents of my DBXML containers?
    Thanks in advance.

    I'm not exactly sure why this worked, but running recovery seems to have fixed my problem.

  • Open Quark using Java

    we are trying to open a quark file thru java in Mac OS 9.2
    the following are the commands we are using but this is throwing an exception
    "com.apple.mrj.macos.toolbox.MacOSError: (error: -43)"
    String[] commandLine = { "open", "123.qxd" };
    Process process = Runtime.getRuntime().exec(commandLine);
    The following Applescript is working fine in apple script editor but how can we incorporate this in java.
    tell application "finder"
    open file "123.qxd"
    end tell
    please let us know ASAP as this is an urgent assignment.

    AppleBhava...
    Sorry, what little I know may be a dangerous thing...
    If it is a valid Java command you may have to rename it to .jar. Other than that you may have to make an applet. Look over "About Apple Applet Runner" Readme.
    ...Ron

  • Problem with opening various text files in notepad through java

    Hi friends,
    I need to open any .txt file in notepad by running the code in Java.I could open the notepad through java but not a perticular file.I dont even want to hard code my program that only one perticular file will open through it.I want it generalised...if anyone could help me,it would be really nice...
    thanks
    Vishal.

    If your program opens notepad I'll delete it because I set UltraEdit as my default editor. So if you already must use system-specific code, how about grabbing a Windows manual to find out how to use the editor registered for these files? (Hint "start").

  • Opening a text file in notepad using swing

    Hi,
    I am trying to getting all files and directoriess from my Home Drive to JTreeModel, and i also want whenever i click into text file the contents should be open in notepad, but i am not able to add this feature, can any one help?
    Suresh

    Suresh_Dewangan_1981 wrote:
    No, I am using java 1.5 only, please help me accordingly.
    import java.io.IOException;
    class StartTxt {
        public static void main(String args[])
            throws IOException
            String fileName = "c:\\temp\\test2.txt";
            String[] commands = {"cmd", "/c", "start", "\"DummyTitle\"",fileName};
            Runtime.getRuntime().exec(commands);
    }Bye
    RG.

  • Error trying to open a file using java.io.* in an Applet

    I have a file called wordlist.txt and I am using java.io.* to open it. When I try it
    in Applet Viewer it runs without a hitch. But when I try to run it in a
    browser as an Applet, it errors out saying:
    com.ms.security.SecurityExceptionEx[package3/SpellCheck.setWordList]: cannot access file wordlist.txt
    I have tried adding this file to my Project and accessing it that way but I still get
    the same message. If anyone can help with this, I sure would appreciate it.
    My code is as follows:
    String inWord = new String("zzz");
    try {
    File myWordList = new File("wordlist.txt");
    BufferedReader inWordList = new BufferedReader(
    new FileReader(myWordList));
    inWord = inWordList.readLine();
    while (inWord != null) {
    wordList.addElement(inWord);
    inWord = inWordList.readLine();
    } // end while
    inWordList.close();
    } // end try
    catch (Exception e1) {
    // Pr is equivalent System.out.println();
    Pr("Error Reading this line " + '\n' + inWord + '\n' + e1);
    } // end catch
    } // end setWordList()

    Applets are generally prevented from reading as well as writing files, but appletviewer can load files from the hard drive, so, that is the cause of the behaviour you have observed. To know more about enabling applets load files, you have to sign your applets,
    learn more at
    http://java.sun.com/sfaq/#prevent

  • New to Java Script(Want to open a new window using Java Script)

    Hi all,
    I am new to using Java Script. Now I have a HTML(First.html) page with a ADD button at the end of the page. What I want to know is, if I drag and select some part of the First.html and click on the ADD button a second HTML page(Second.html) should open displaying only the selected contents....
    Please help :-(

    myRef = window.open(self.location,'mywin',
    'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

  • Open a PDF file in linux using java

    Hi..
    How can I open a PDF file in linux using java.
    I am able to open PDF in windows and mac using this code
    in Windows
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + path_of_PDF);
    in mac
    Runtime.getRuntime().exec("open " + path_of_PDF);
    But nothing is working with linux.
    Please help
    Thanks

    One thread is enough:
    http://forum.java.sun.com/thread.jspa?threadID=5267458

  • Open PDF file in linux using java

    Hi..
    How can I open a PDF file in linux using java.
    I am able to open PDF in windows and mac using this code
    in Windows
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + path_of_PDF);
    in mac
    Runtime.getRuntime().exec("open " + path_of_PDF);
    But nothing is working with linux.
    Please help
    Thanks

    appi wrote:
    Hi.. I found the JDIC binary files. There are different binaries for all the plateform. Is there any solution which is independent of plateform.Yes, and we already told you: Use JDK6, which has those libraries built into the standard class library.
    How can I use these binaries in my existing project. does it work, If I place them at same place where other .class files are kept.Read the documentation of the JDIC project. I'm sure they answer this question in their FAQ.

  • How to open Word Document using java?

    Respected Sir/ Madam,
    I am doing my project in Network Security using java. I have to transfer the files from server to the client. Each transferred file should have some of the access privileges such as read, write and exeucte. If the transferred file is a word document means then automatically the client should open Microsoft word and if the file is having Read Permission alone then the save, Save As, cut,copy, paste options in the MS - Word should be disabled. This is similar for all the files that i have transferred. That is if the transferred file is excel, audio, video,txt file the corresponding application should be opened properly. How could I acheive this. If the file is having write permission then if the user clicks the save option then the contents of the file should be saved in the server machine not in the client machine, Could we achieve this???? Can anyone help me regarding this? Please give me your views about this query?

    Respected Sir / Madam,
    Thank you very much for your reply. Could we use Microsoft API inside java program to achieve my doubts?? Could U explain it more????

  • How to open acrobat in java and compare two files using javacode

    I am absolutely new to use acrobat software in Java. I want to open two pdf files at a time and then compare the differences between them thru java program .
    i am not sure how to do it. iam trying many ways without success.
    I used jre and could open open files using runtime method , but couldn't do comaparision. i..e could't access tools menu (alt+t) Compare two files and <enter>. help in java will be appreciated.
    Pls guide me the steps to use the acrobat library. At http://partners.adobe.com/asn/acrobat i found supporting vb and vc only.
    Any help or links are greatly appreciated.

    iText is an open source PDF library, reads a PDF one page at a time. You could check it out. I've used it for writing/splitting/concatenating PDFs, but not comparing files
    http://www.lowagie.com/iText/
    Scott
    http://www.swiftradius.com

Maybe you are looking for