Java Swing frame for modification Excel file or Word file with All menu...

Hello All,
Can Any one help me for making java Swing frame for modification Excel Data or word file with all Menu.. Plz send me java Code for that.. I am bit new in Swing.
i am waiting for ur help..
Thanks
Samir

hi pbrockway2 ,
Can you go through this program Sir, i am trying to call Excel content below of menu. when i will press Edit button then excel content should come below with Cut, copy, paste , Save Button..
Plz help me sir...
import javax.swing.*;
import java.io.*;
import java.awt.event.*;
public class TestReader
private static void createAndShowUI()
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame=new JFrame("Test Reader");
JButton button=new JButton("Edit");
button.addActionListener(new ButtonListener());
frame.getContentPane().add(button);
frame.setVisible(true);
frame.pack();
static class ButtonListener implements ActionListener
public void actionPerformed(ActionEvent event)
openTheFile();
private static void openTheFile()
try
String commands[]=new String[3];
commands[0]="cmd.exe";
commands[1]="/C";
commands[2]="INSTALL.LOG"; // here file name is supposed to be in the working dir
Runtime rt=Runtime.getRuntime();
Process proc=rt.exec(commands);
StreamGobbler errorGobbler=new StreamGobbler(proc.getErrorStream(),"ERROR");
StreamGobbler outputGobbler=new StreamGobbler(proc.getInputStream(),"OUTPUT");
errorGobbler.start();
outputGobbler.start();
catch (Exception e){}
public static void main(String args[])
SwingUtilities.invokeLater(new Runnable()
     public void run()
     createAndShowUI();
static class StreamGobbler extends Thread
InputStream is;
String type,root;
StreamGobbler(InputStream is,String type)
this.is=is;
this.type=type;
public void run()
try
InputStreamReader isr=new InputStreamReader(is);
     BufferedReader breader=new BufferedReader(isr);
     String line=null;
     while ((line=breader.readLine())!=null)
     System.out.println(type+">"+line);
catch (Exception e)
     System.out.println(e);
Thanks
SamiR

Similar Messages

  • HOW TO PRINT  THE EXCEL CELL COMMENT IN JAVA SWING FRAME ?

    How to print the excel cell comment in java swing frame
    user can print the data of cell with comment in bracket in java swing frame.
    please make one java code to read an excel spreed sheet and print the output in Java swing frame as follows
    EMP NO - 1, 2, 3
    EMP NAME - aname (amitesh:very good), bname (amitesh: average), cname (amitesh: very bad)
    EMP AGE - 11, 22, 33
    EMP DESG - ad, bd, cd
    Note: the bracket portion is the excel comments put in that cell

    hello everyone i'm new to this forum..how are you all...
    Jack Brosnan
    [mobile phone|http://www.mobilephonesforsale.net.au/apple-iphone-f-2.html]

  • Where can I downlaod java swing library for JDk?

    where can I downlaod java swing library for JDk?

    Are you sure you don't have Swing? It comes with the JDK. If you don't have it, look at http://java.sun.com/products/jfc/download.html
    If you are using JDK 1.1, you can download Swing alone - but be aware that this is an old version. You would be best advised to download the Java SDK 1.3.1, which includes Swing 1.1.
    Regards,
    Matt

  • I purchased the package that allows you to export PDF files into Word files.  Whenever I try to export the PDF into a Word file it never works...  I don't know if there's something key that I'm missing but I'm pretty bummed I paid for it and it won't work

    I purchased the package that allows you to export PDF files into Word files.  Whenever I try to export the PDF into a Word file it never works...  I don't know if there's something key that I'm missing but I'm pretty bummed I paid for it and it won't work.  Can anybody help me out?

    Hello,
    I have paid for this service for a year and it never worked on my computer.  I just renewed and it finally converted the file but it will not let me edit it.  I join you in being bummed.  Either I get help with this or I am asking for a 2 year refund.   My intention was to be able to edit a pdf in MS Word. 
    pfierrorob

  • I've just bought a new mac and I want to transfer the content from my old Macbook to my new. If I have iCloud enabled on both devices, is this simple, or is there a limit to what I can transfer? For example, can I upload word files to iCloud?

    I've just bought a new mac and I want to transfer the content from my old Macbook to my new. If I have iCloud enabled on both devices, is this simple, or is there a limit to what I can transfer? For example, can I upload word files to iCloud?

    iCloud is not the way to do this. You should use Migration Assistant - with this you can transfer your complete User folder from the old Mac including preferences and logins. You will need to connect the two with FireWire or USB depending on the models.
    Ideally you should do this before you set up the new Mac - if you create a user account with the same name than the Migration will have to give the migrated user folder a different name. When you first switch on the new Mac it should ask you if you want to transfer your data, and give you instructions.

  • Convert Adobe form (PDF file) to Word file

    Hi,
    my need is in the title, i would like to convert a Adobe Form, in fact a pdf file to word file. What is the best way ? And of course is it possible ?
    Thanks for your help.
    Cheers.

    Hello,
    nothing like this cannot be done. You can generate interactive form if you need your user to fill in some more details. You can generate Word for example using OLE. There is a nice SDN contribution on generating MS Word using SAP Word OLE. Regards, Otto

  • I just bought a Shuffle for my wife. I have a Touch. When I plugged the Shuffle in for the first time it sync'ed with all my Touch stuff and filled up. I have created a playlist that I would like to install on the Shuffle. How do I keep the Shuffle from s

    I have a Touch. It sync's automaticly when I plug it in. I like this.
    I bought a Shuffle for my wife today. I want to put a playlist on it. When I plugged it in for the first time, it sync'ed with all my Touch stuff and is now full.
    How do I empty the Shuffle.
    How can I plug the Shuffle in if it automaticly fills up with my Touch stuff?
    I have windows xp.
    Thanks,
    Jeff

    Some apps that you download on your iPhone may possibly be to new for the iPod touch 2nd gen. I have a iPhone 5 and a iPod touch 2nd generation myself. If you plug his ipod into iTunes and restore it from a backup of your iPhone than it will download the paid apps and music that are compatible with his ipod. Hope this helps.

  • I have acrobat 11 standard is it possible to convert pdf files to word files ?

    I have acrobat 11 standard is it possible to convert pdf files to word files ? or is it just possible in the Pro version.

    It sounds to me like you're using Reader, not Acrobat. Make sure you open
    the PDF file in Acrobat, and then go to File - Save As Other - Microsoft
    Word.
    On Thu, Mar 12, 2015 at 2:55 PM, nickk23435928 <[email protected]>

  • HT204266 Why does only one headphone work when i listen to music? I have to hold the base of the cord in a certain position for it to work, it does this with all headphones i try, what do i do?

    Why does only one headphone work when i listen to music? I have to hold the base of the cord in a certain position for it to work, it does this with all headphones i try, what do i have to do?

    You can try cleaning the headphone jack. However, I suspect that th headphone jack needs replacement.
    Apple will only exchange your iPod for a refurbished one for this price.
    Apple - Support - iPod - Repair pricing
    A third-party place like the following is less expensive. Google for more places.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • How to print an Doc file(MS Word File)on a printer in JAVA

    Hi.I am Prakash.
    Folowing is the code that i have used to print an doc file on a printer. Problem is that , when i run this code it will provide me an printout of a doc file.,but not in well formate as the actual formate of the file. If any one tried this before plz help me.Thanks
    import java.lang.reflect.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Graphics2D;
    import java.io.*;
    import javax.swing.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.print.event.*;
    public class BasicPrint {
         JFrame frame;
         JButton btn;
         private boolean PrintJobDone = false;
         protected void MakeGui() {
              frame = new JFrame("PrintService");
              btn = new JButton("Cancel Print Job");
              btn.disable();
              frame.getContentPane().add(btn, BorderLayout.SOUTH);
              frame.pack();
              frame.setVisible(true);
         BasicPrint(String FileToPrint, String pMode) {
              try {
                   MakeGui();
                   File baseDir = new File("d:/doc");
    File outDir = new File(baseDir, FileToPrint);
                   // Open the image file
                   InputStream is = new BufferedInputStream(new FileInputStream(
                             outDir));
                   // Find the default service
                   DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   //DocFlavor flavor = new DocFlavor("application/msword", "java.io.InputStream");
                   //DocFlavor docFlavor = new DocFlavor("application/vnd.ms-word", "java.io.InputStream");
                   if (pMode != null && pMode.equalsIgnoreCase("PS"))
                        flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
                   else if (pMode != null && pMode.equalsIgnoreCase("PDF"))
                        flavor = DocFlavor.INPUT_STREAM.PDF;
                   else if (pMode != null && pMode.equalsIgnoreCase("JPG"))
                        flavor = DocFlavor.INPUT_STREAM.JPEG;
                   else if (pMode != null && pMode.equalsIgnoreCase("GIF"))
                        flavor = DocFlavor.INPUT_STREAM.GIF;
                   else if (pMode != null && pMode.equalsIgnoreCase("PNG"))
                        flavor = DocFlavor.INPUT_STREAM.PNG;
                   else if (pMode != null && pMode.equalsIgnoreCase("PCL"))
                        flavor = DocFlavor.INPUT_STREAM.PCL;
                   else if (pMode != null && pMode.equalsIgnoreCase("RAW"))
                        flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT16"))//****                                   *********
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16;
                        System.out.println("****ACTIVE***");
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTBE"))//****
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16BE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTHOST"))//***
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_HOST;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT8"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_8;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTASCI"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
                   else if(pMode != null && pMode.equalsIgnoreCase("TXTLE"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16LE;                                        //*******
                   else if(pMode != null && pMode.equalsIgnoreCase("SEVICE"))
                        flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
                   String type = flavor.getMediaType();
                   System.out.println("Type ="+ type);
                   //IMPRIMIR prakashCV.doc TXT text/plain; charset="utf-16le"; class="java.io.InputStream"
                   System.err.println("* IMPRIMIR " + FileToPrint + " " + pMode + " "
                             + flavor);
                   PrintService dservice = PrintServiceLookup
                             .lookupDefaultPrintService();
                   PrintService[] services = PrintServiceLookup.lookupPrintServices(
                             flavor, null);
                   if (services == null || services.length < 1)
                        services = PrintServiceLookup.lookupPrintServices(null, null);
                   PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
                   aset.add(new Copies(1));
                   aset.add(OrientationRequested.PORTRAIT);
                   // aset.add(MediaTray.MAIN);
                   aset.add(Sides.ONE_SIDED);
                   aset.add(MediaSizeName.ISO_A4);
                   PrintService service = ServiceUI.printDialog(
                             (GraphicsConfiguration) null, 60, 60, services,
                             (PrintService) dservice, (DocFlavor) flavor, aset);
                   if (service != null) {
                        // Create the print job
                        final DocPrintJob job = service.createPrintJob();
                        Doc doc = new SimpleDoc(is, flavor, null);
                        // Monitor print job events; for the implementation of
                        // PrintJobWatcher,
                        PrintJobWatcher pjDone = new PrintJobWatcher(job);
                        if (job instanceof CancelablePrintJob) {
                             btn.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       CancelablePrintJob cancelJob = (CancelablePrintJob) job;
                                       try {
                                            cancelJob.cancel();
                                       } catch (PrintException e) {
                                            // Possible reason is job was already finished
                             btn.enable();
                        try {
                             // Print it
                             job.print(doc, (PrintRequestAttributeSet) aset);
                        } catch (PrintException e) {
                             e.printStackTrace();
                        System.err.println("* Impresion Realizada - Esperando ..");
                        // Wait for the print job to be done
                        pjDone.waitForDone();
                   // It is now safe to close the input stream
                   is.close();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   try {
                        synchronized (BasicPrint.this) {
                             PrintJobDone = true;
                             BasicPrint.this.notify();
                   } catch (Exception e) {
                        e.printStackTrace();
         public synchronized void waitForDone() {
              try {
                   while (!PrintJobDone) {
                        wait();
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              try {
                   //args[0]="t";
                   //args[1]="rr";
    //               if (args.length < 1) {
    //                    System.err.println("\nSintaxis:\n\n java BasicPrint FileToPrint [pMode]\n");
    //                    System.exit(0);
                   BasicPrint bp = null;
                   //if (args.length < 2){
                        //bp = new BasicPrint(args[0], null);
                   //}else{
                        //bp = new BasicPrint(args[0], args[1]);
                        bp = new BasicPrint("prakashCV.doc","SEVICE");                                                       //****/***
                   bp.waitForDone();
                   System.exit(0);
              } catch (Exception e) {
                   e.printStackTrace();
         class PrintJobWatcher {
              // true iff it is safe to close the print job's input stream
              boolean done = false;
              int lastEvent = 0;
              PrintJobWatcher(DocPrintJob job) {
                   // Add a listener to the print job
                   job.addPrintJobListener(new PrintJobAdapter() {
                        public void printJobRequiresAttention(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* La impresora requiere de su Atencion ! * "
                                                 + pje);
                             // allDone();
                        public void printDataTransferCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* Transferencia de datos a la impresora OK. * "
                                                 + pje);
                             // allDone();
                        public void printJobCanceled(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Trabajo de impresion CANCELADO ! * "
                                       + pje);
                             allDone();
                        public void printJobCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Impresion completa OK. * " + pje);
                             allDone();
                        public void printJobFailed(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* ERROR en la Impresion ! * " + pje);
                             // allDone();
                        public void printJobNoMoreEvents(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* No mas eventos de impresion * " + pje);
                             allDone();
                        void allDone() {
                             synchronized (PrintJobWatcher.this) {
                                  done = true;
                                  PrintJobWatcher.this.notify();
              /** Description of the Method */
              public synchronized void waitForDone() {
                   try {
                        while (!done) {
                             wait();
                   } catch (InterruptedException e) {
                        e.printStackTrace();
    }

    Hi Maxpkh
    Do you mean attachment? You can't do that with free Adobe Reader you need Acrobat to do this.
    ~Deepak

  • Frame being created when linking a Word file

    Robohelp HTML version 8.0.2.208
    I have recently been given a new PC on which RoboHelp 8 has been reinstalled and my version of Microsoft Office updated from Office 2003 to Office 2007. Previous to this upgrade I was using the Link > Word Document feature without any problem for both Word and RTF files. However, following the upgrade when I now link a Word document or RTF file I get the following two issues:
    1) Each topic is now created within a frame using the <div class="WordSection1"> token. No frame was created previously.
    2) The first topic of the linked file is now repeated with the first instance having a htm file name that includes the Heading name plus the first line of text from the file (even though the first line of text is set to a different style). The resulting topic has no content, simply an empty frame.
    My operating system has not changed and remains as Microsoft Windows XP - Service Pack 3.
    Does anyone know if there is a setting in RoboHelp somewhere that I have not reset with the new install, or could this be a Micorsoft Office issue?
    Thanks,
    Chris

    I'm seeing the same, albeit with Word 2010. Right now I cannot see any way around it. Note that to remove it, it is only necessary to remove the opening DIV tag. RoboHelp removes the closing tag for you.
    Not ideal but I cannot see any way of avoiding it.
    Please follow this link and report it as a bug.
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Generating XML file from WORD file

    hello
    Everyboby.
    I am trying to generate xml file from a word file.
    but i am stucked with how to do it? any kind of help will be useful.
    i think for doing this work i have to develop XSD file, because when i am creating the xml file, the hidden space within the word file is not catched.
    please help me out.
    waiting for reply
    thanks
    milind

    hello
    after searching on the net i came to know that org.apache.poi.hwpf.* is used for reading word file and its contents. for converting it to xml i have to use org.exolab.castor.xml.*
    now my problem is that POI is in its early beta version and there is no help or any sample examples for understanding the api.
    so if you have any idea regarding it, please write to me.
    waiting for your reply.
    thanks
    Milind

  • How to save as AI file in same location with all text curves?

    Hi Guys,
    I am also looking for a script. Here are the details....
    I do have lot of AI files (from different paths), which are completly work  done. So I just need to make them (all files) a copy with all text  curves in the same path should create folder name called 'LC'.
    From  the given path all the files should save as to 'LC' folder. ('LC'  folder needs to create at the same location and original file should  stay as it was, so no changes in original/source file)
    While  making curves we must remember that layers contains lock. So have to  unlock all the layer and make curves and lock them back.
    While save as the all files in the file names should add '_LC' at last. For example: file name is 'xyzxyz.ai'. It should come 'xyzxyz_LC.ai'
    FYI: Using Adobe CS4...
    if you help me that would be really grateful...
    Thanks in advance..
    Kind Regards
    HARI

    Hello Hari,
    maybe this could be a startingpoint for you:
    var lb="\n";
    function writeNtimes(max){
         // read about namespace and visibility
         var string2 = "Read the F. Manual!";
         for(i=0;i<max;i++){
              //about loops
              alert(string2);
    function tieMyShoes(){
         if(willingness){
              //about conditional statements
              var refs = "Mozilla js reference and guide - very good\nAdobe Illustrator and ESTK references";
              alert(" Please start with the following "+lb+lb+refs);
              // about Strings
              gotIt=true;
         }else{
              var moocher = confirm("are you just looking for someone doing your work for you for free?");
              if(moocher){
                   writeNtimes(10);
              }else{
                   gotIt=confirm("Yes I understand");
    var aString = "Hello HARI";
    alert(aString);
    var gotIt = false;
    var willingness = confirm("are you interested in learning Illustrator JS?");
    var string2="RTFM!";
    while(gotIt==false){
         tieMyShoes();

  • Fix for Dreamweaver CC 2014.1 JavaScript Error With All ASPX Files

    Entire morning wasted.
    Adobe's upgrade to Dreamweaver 2014 to 2014.1 on Windows 7 Professional has broken the product across the board and it no longer opens any .aspx pages correctly.  A large number of people use .NET and now we can no longer access/use these files/pages without multiple JavaScript errors.  Particularly those that have edited the MMDocumentTypes file to make the product work in the first place since they stopped supporting the users that develop in ASP.NET.
    Every time a .aspx file is now opened, the following JavaScript error is received: "While executing translateCustomControl in ExternalRenderers.html, a JavaScript error occurred.  Click 'close' and it appears again...over and over.  Our sites are all unable to open in DW because of this.  It worked fine in earlier versions of DW, including 2014.  It's only 2014.1 that broke everything.
    The fix for this:
    1. Follow instructions on this out-of-date help file: Change, add recognized file extensions | Dreamweaver
    2. (and the part that's new): The MMDocumentTypes file is located in  C:\Users\*your username*\AppData\Roaming\Adobe\Dreamweaver CC\Configuration\DocumentTypes directory. Open that file and add aspx back to the <documenttype id="HTML"> declaration at the top.
    I am posting this issue here in hopes that some of the users won't waste most of the day trying to figure this out.
    Chris Lee

    Hi Ivan,
    I'm having that exact same problem now...in addition to that JavaScript error message coming back.  I submitted a bug report last week about this and received the following reply:
    Hi Chris,
    We would like to let you know that we able to reproduce this issue at our end. Thanks for reporting this.
    We will try to prioritize it for fixing. This might take some time. We thank you for your patience with us in this regard.
    Please let us know if you need help regarding anything else. We will be more than happy to help you.
    Thanks,
    Arindam Ghosh
    Dreamweaver Team,
    Adobe Systems
    Hopefully they can get this fixed soon, as it's ground my work in the software to a halt.
    Chris

  • How to create a new doc file Microsoft Word file using POI

    I have searched on the guide of POI's HWPF package for writing a new file but i couldnt find that pls help..

    hi,
    related link
    http://forum.java.sun.com/thread.jspa?threadID=670895&messageID=3947161

Maybe you are looking for

  • Issue connecting ios 7 devices to WPA2 wifi networks

    I am using Cisco Wireless in our corporate environment.  We are using Enterprise WPA2 security which requires the user to accept the certificate.  I am no longer able to connect to these networks after installing ios 7 except for a newtork that I alr

  • Project Online Permissions

    Hi!!! I am new to Project Online. So far, I have created many users (Project Lite) and (1) Project Manager (Project Full). The PM can create Projects and share them with other users. The problem is when the PM wants to grant Access to other users, th

  • Need help with Click Frequently Asked Questions in iProcuremenet purchasing

    Hi Guys, In iProcurement purchasing homepage, we have 1. Click Frequently Asked Questions and 2. Review Purchasing policies on the right side as links. When we click Frequently Asked Questions, its taking me to a page where standard FAQ is there. Now

  • Retrieving the union of letters from two or more character strings

    Dear Gurus, Need your help in writing ABAP logic for the below requirement. Assume we have Var1 = 'ABCD' , Var2 = 'CDEF' and Var3 = 'EFGH'. The requirement is to populate Var4 with union of the letters from the above three strings. That means, Var4 s

  • Help enabling my disabled Apple ID

    My AppleID was disabled for security reasons. I am told I need to change my password on iForgot. But my AppleID is set up with an Apple email (@me.com) - so I can't get a replacement email sent to my address because that is disabled too, and when I p