How would I print information to a DOS window?

Ok so I can get the DOS window running by using this code:
      try{
                   Runtime rt = Runtime.getRuntime();
                   Process child = rt.exec("cmd.exe /c start cmd.exe");
                   child.waitFor();
               }catch(IOException io){}
               catch(InterruptedException e) {}but I want to print the information from this code:
StringBuffer objectString = new StringBuffer("");
////some code here//////
objectString = new StringBuffer(("Customer:\t\t" + customerName + "\n"
                           + "Departure Date:\t" + departureDate + "\n"
                           + "Return Date:\t" + _returnDate));
////some code here/////
objectString.append("\nAirline:\t\t" + airlineBG.getSelection().getActionCommand());
objectString.append("\nDestination:\t" + destinationBG.getSelection().getActionCommand());
/////more code. yay//////
objectString.append("\nPrice:\t\t" + price);
objectString.append("\nTicket Bought. Have a safe flight!");
System.out.print(objectString.toString());//print string bufferso how would I print objectString to the DOS window?
Note: opening the DOS window is in the constructor for the JFrame I am using while printing the StringBuffer is in the actionPerformed implementation.

masijade. wrote:
deadmanwalkin wrote:
no, the program im supposed to be making asks to print ticket information to a DOS window.
I might have interpreted it wrong and it could be just start from a DOS window using the java File commandWell, study your assignment text. If it does not explicitly state that you must programmatically open a new "DOS window", then simply print your output using System.out.println().Unless he's running Windows 95 still he can't even open a DOS window as there's no more DOS ;)

Similar Messages

  • How can I print a pdf file in Windows 8?

    I'm new to Windows 8. How can I print a pdf file in Windows 8?

    Well, you can install Adobe Reader XI - not the version for Windows 8 tablets, but the one for regular PCs. This is just the same in Windows 8 as other systems, and can print. The tablet reader, which also runs on PCs, can't print.

  • How do i print calendar from icloud using windows 7?

    Forgive me if this question is out there and has been
    answered – I’m sure it is but I can’t find it.
    How do I print a day or series of days of my calendar from icloud?
    I have an ipad mini and ipad 2 but I want to print the calendar from icloud
    using a laptop with Windows 7.
    Any assistance would be greatly appreciated.
    Thanks

    I am tempted to answer that question with one simple sentence - " using printer".
    I understand that there is some underlying concern, just can't guess what it is yet. May be you can elaborate...

  • How to install Printer HP LaserJet P2015 in Windows 7!

    Dear all!
    I am luck using windows 7-32bit. I would like to install Printer HP LaserJet P2015 in Windows 7, but I can't install it because when installing, I get it failed. In fact, I can install it in Windows XP without any obstacles, but now I upgrade to Windows 7 32-bit. Would you mind telling me what to do to solve it?
    Thanks a lot and I am looking forward to hearing from all.
    My best regards,
    LUCK
    This question was solved.
    View Solution.

    Hi LUCK,
    The printing functionality for your driver is prodided by the HP Universal Print Driver.
    You may download the driver by clicking the Download button from the link below:
    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=18...
    If you may find it hard to understand any of the installation steps, you may find the full details below:
    http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?&objectID=c02536202#A6
    Please let me know of any needed clarification.
    Sincerly,
    Shlomi
    http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?&objectID=c02536202#A6
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • How can i print a PDF doc in Windows 8?

    How can i pring a PDF doc in windows 8?, i did not find a printing function anywhere.

    See FAQ: Printing from Adobe Reader for Windows 8 Tablets.

  • How would I deploy my iOS app on Windows?

    Hey guys, I want t know what do I need to test iOS games made from Flash Builder 4.6 and Flash CS6? I am on a Windows Machine, and I was wondering how would I test it on an iOS device? My sister has a Mac so I would be able to upload to the App Store after development, I just wanted to know how would I test on Windows since I don't want to use her Computer until I need to upload to the App Store.

    I think you were able to create certs and profiles on a PC but Apple has revamped there whole system regarding developers so not to sure you can do it now on a PC. It's easier to do on a Mac. I can't go into details about the full process cuz there are a lot of steps but you can find many tutorials online covering that.  Basically once you have your account set up, you create a p12 certificate and a provisioning profile. For profiles you create one for distribution for adhoc. Then you create another for distribution for AppStore. In flash you bundle the cert and a profile into the IPA file. Also before you create profiles register your devices and any else's you plan to have test for you. You can have 100 devices per year. I have a group of people that test for me and have them all on Testflight. So they all receive an email from me and install the app right out of the email on there device. Use the adhoc profile for testing then when ready use the Appstore profile to upload to iTunes.

  • How would I get information out of a Cdata tag?

    Read in CDATA[] based information? I can never find out how to access the data inside of Cdata. Any one got any ideas? we never covered this in school and google just confuses me. So how do you get all the data out of Cdata to do what ever with it? this is for converting xml to cvs - which I think I can do, I just need to get the data out of cdata ...
    Edited by: 910481 on 26-Jan-2012 20:35

    Ok so now I have some code but its spitting out the second return, which states "there isn't anything there"
    package xmlcsv;
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.CharacterData;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    * @author Adam Balan
    public class XmlCSV {
          * @param args
         public static void main(String[] args) throws Exception {
              File file = new File("Data.xml");
              DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
              Document doc = db.parse(file);
              NodeList nodes = doc.getElementsByTagName("TransmissionWrapper");
              for (int i = 0; i< nodes.getLength(); i++){
                   Element element = (Element) nodes.item(i);
                   NodeList cData = element.getElementsByTagName("TransmissionData");
                   Element line = (Element) cData.item(0);
                   //test
                   System.out.println("Data: " + getCData(line));
          * We want to get all the data out of the CData Section
          * @param e
          * @return
         public static final String getCData(Element e)
              Node child = e.getFirstChild();
              if(child instanceof CharacterData)
                   CharacterData cd = (CharacterData) child;
                   return cd.getData();
              return "Theres nothing there";
    }the tag would be:
    <TransmissionWrapper>
        <TransmissionData Name="bla" Value="bla bla">
           <![Cdata[Bla|bla]]>
        </TransmissionData>
    </TransmissionWrapper>So...What am I doing wrong for it to spit out: Theres nothing there
    Thanks for your help and paitence
    Edited by: Salacious on 27-Jan-2012 11:46
    Edited by: Salacious on 27-Jan-2012 11:46

  • Does anyone know how to discard printer information from a report?

    Hello all,
    We've got several reports in which printer info is saved in the report.
    We would like to remove that info programmatically from the report.
    Does anyone how to do that and to save this modified info to the report?
    I would be pleased to be given a code example.
    I guess it should be something like the fragment below, but saving this to the report doesn't seem to be doable.
    printOptions.SavedDriverName = printOptions.DriverName = "DISPLAY";
    printOptions.SavedPortName = printOptions.PortName = string.Empty;
    printOptions.SavedPrinterName = printOptions.PrinterName = string.Empty;
    printOptions.PaperSize = CrPaperSizeEnum.crPaperSizeDefault;
    printOptions.PaperOrientation = CrPaperOrientationEnum.crPaperOrientationDefault;
    printOptions.PaperSource = CrPaperSourceEnum.crPaperSourceAuto;
    report.ReportClientDocument.PrintOutputController.ModifyPrintOptions(printOptions);
    report.ReportClientDocument.PrintOutputController.ModifyPrinterName(string.Empty);
    report.ReportClientDocument.PrintOutputController.ModifyPageMargins(0, 0, 0, 0);
    report.ReportClientDocument.PrintOutputController.ModifyPaperOrientation(CrPaperOrientationEnum.crPaperOrientationDefault);
    Thanks,
    Henk Spaan.

    Hello Henk,
    You could simply check the 'No Printer' option in the report.
    From designer check File --> Page Setup --> No Printer.
    Or do it programatically.
    http://scn.sap.com/community/crystal-reports-for-visual-studio/blog/2010/09/15/how-to-check-no-printer-on-a-crystal-report-using-the-ras-sdk-in-net
    - Bhushan
    Senior Engineer
    SAP Active Global Support
    Follow us on Twitter
    Got Enhancement ideas? Try the SAP Idea Place
    Getting started and moving ahead with Crystal Reports .NET applications.

  • How to acees printer information using JDMK

    Hi,
    plz send the code to access the printer using javacode
    Thanks&regards,
    kirankumar

    Hi,
    plz send the code to access the printer using javacode
    Thanks&regards,
    kirankumar

  • How to copy printed information onto party invitations that has a colorful bordered paper.

    I have a party invitation that has a colorful border with a blank white area in the middle for text.  There are two invitations on a single sheet of paper that is a standard letter size of 8-1/2 by 11.  I have double printed the text I want on a standard letter size piece of paper and tried to copy the text onto the invitation without success.  When trying to print,  I keep getting an error message that says "paper detected does not match paper size or type selected.  I need help in setting up the printer to allow me to copy. Help please!!

    Thank you Sukrit for responding.
    The computer I am using is controlled by a government agency.  They do not allow users to install or modify any software.  The file I am using, though a public document, may not be advisable to be posted online.
    However, my solution to the issue was to reprint the document that I was pasting into and modifying the print settings to rotate the PDF image.  First, I had to change the size of the PDF beyond the original full size dimensions to account for the scale change.  Then change the print settings to print landscape while telling adobe's advanced settings to print portrait.  After some finesse with other settings for scale, I was able to copy and paste the polygon without loosing the scale.  This took me a week to figure out.  An extreme waste of time for such a simple issue that should not occur in such a popular software.

  • How would I get information from Windows Media Player to determine when a file is finished playing?

    I am creating a program to for Windows Media Player. This program will use external buttons connected to a PCI card to read when a user presses a particular button. I need the program to wait until the video is complete before doing anything else. Is there any way to read this information with a property node?
    Help will be much appreciated.
    Solved!
    Go to Solution.

    Attached is a very simply example (LV 8.2) of using that event.
    You need to head over to Microsoft to get the details on the Windows Media Player properties and methods: http://msdn.microsoft.com/en-us/library/windows/desktop/dd564680%28v=vs.85%29.aspx
    Attachments:
    main.vi ‏16 KB
    callback.vi ‏12 KB

  • How do I print a pdf file from windows 8?

    I can't find a command to print a pdf file. I'm working with windows 8. can anybody tell me how do I find that command?

    Please see FAQ: How to print a PDF file from Adobe Reader Touch.
    Starting from version 1.1, Adobe Reader Touch supports printing.
    If you do not see the Print button in the toolbar, you have an older version of Adobe Reader Touch. Please download and install the latest version of Adobe Reader Touch via the Windows Store.

  • How would i install and configure HS on windows?

    Hello,
    I would like to explore more about installing and configuring HS on windows box (64-bit).
    I have two questions.
    1)Is there OD4ODBC software avaliable for 64-bit windows? if not 32 - bit software works with 64-bit windows OS and 11G Database which is also 64-bit?
    2)can some provide me more steps to configure it, if it's possible.
    3) is there any other way to connect ro MS SqlServer from Oracle other than using ODBC/Gateways?
    Thanks,
    Steve.

    For 64bit Windows you need to have a 64bit DG4ODBC - DG4ODBC 64bit for Windows was first released with 11.2.
    1)Is there OD4ODBC software avaliable for 64-bit windows? if not 32 - bit software works with 64-bit windows OS and 11G Database which is also 64-bit?
    => No - only 64bit DG4ODBC is supported - so please use DG4ODBC 11.2
    2)can some provide me more steps to configure it, if it's possible.
    Please have a look at this note: How to Configure DG4ODBC (Oracle Database Gateway for ODBC) on 64bit Windows Operating Systems to Connect to Non-Oracle Databases Post Install          [Document 1266572.1]     
    which is available through My Oracle Support portal.
    3) is there any other way to connect ro MS SqlServer from Oracle other than using ODBC/Gateways? The easiest way is a gateway, but you could use a JDBC driver and load the MS SQL Server JDBC driver into the JVM of the Oracle database, then code the connection.

  • How do I print a PDF Portfolio in windows 8 without crashing?

    Every time I try to print a pdf portfolio it crashes. Doesn't matter what printer I choose. This is Acrobat pro 10.1.7 and Windows 8.
    This makes PDF portfolios useless for my purposes.

    Well, you can install Adobe Reader XI - not the version for Windows 8 tablets, but the one for regular PCs. This is just the same in Windows 8 as other systems, and can print. The tablet reader, which also runs on PCs, can't print.

  • How do you print using Reader 9 & PC Windows 7 from Access app?

    I have an Access database that has a link to each pdf.  Each pdf has an embedded javascript for sequentially numbering and automatic print.  The pdf will not print to the printer.  If I open the pdf and fill out the fields, the pdf prints and the javascript works for sequentially numbering each label that prints out.  Really need help with this as our system is print-on-demand for labeling and shipping packages.  PC Windows 7 and Reader 9.  Thank you.

    Do you mean the bookmarks? If so, you can't (Except with screen captures)

Maybe you are looking for

  • External Hardisk not detected

    I was trashing things from the external hard disk because i wanted to clear it up when it suddenly hanged. I then restarted the mac and for some reason the hard disk could not longer be detected. I tried unplugging and replugging the connection, trie

  • HT1766 White Screen, NOTHING works! PLEASE HELP!!!

    Okay, so I was on the Facebook app on my iPod Touch... Then the screen froze, shortly after that my screen turned white. The two button thing isn't working and i don't know what to do, i don't live near an Apple Store, and i can't go there. so someon

  • Safari Webpages not loading right

    I have pages that will not load correctly, now that I use  7.0 and Maverick how do I fix this?

  • MacBook Pro Retina Thunderbolt Ethernet issues

    hi Folks I have a macbook Pro Retina 15" here, using the thunderbolt ethernet adaptor. if i boot the machine into windows 7 with the ethernet thunderbolt adaptor plugged in,  it works fine. however if i remove it while windows 7 is loaded , and then

  • Drop Rate Exceeded

    I just upgrade our MARS to 6.03 and and I am getting this message from our ASA. I was simply going to place in a drop rule, but there is no IP address to use for the rule. The IP address are all NA. Drop Rate Exceeded N/A 0 N/A N/A N/A Can I create a