Pledgie



if you think this library has been useful, feel free to give any help. Don't be shy.


Click here to lend your support to: Java2word, coding for fun! and make a donation at www.pledgie.com !

Wednesday, February 5, 2014

java2word soon in github

It is time!!!

I am gonna move this library to Github to allow better collaboration.

Url will be: https://github.com/leonardoanalista/java2word

I will perform the changes in a couple of days.


I am now doing front-end development. So I don't have enough time to maintain the code base. Collaborators are welcome!


Leonardo Correa

4 comments:

  1. Hello I am getting a error when I running the application I built using the java2word library, I am getting this error.

    Exception in thread "AWT-EventQueue-0" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/context/FacesContext

    now I see that I need to add something to get the struts or the seam, is there an example on Seam I can see or something ?

    ReplyDelete
    Replies
    1. I was able to figure it out I made a simple printwriter with a jfilechooser. You should consider adding it to your code in github or a note.


      if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION)
      {

      System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory());
      System.out.println("getSelectedFile() : " + chooser.getSelectedFile());
      }
      else
      {
      System.out.println("No Selection ");
      setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      JOptionPane.showMessageDialog(this, "File Save Canceled.");
      return;
      }

      if(!chooser.getSelectedFile().toString().isEmpty())
      {
      if(!chooser.getSelectedFile().toString().endsWith(".doc"))
      {
      path = chooser.getSelectedFile().toString() + ".doc";
      }
      else
      {
      path = chooser.getSelectedFile().toString();
      }
      }
      else
      {
      System.out.println("No Selection made");
      setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      JOptionPane.showMessageDialog(this, "File Save Canceled.");
      return;
      }


      PrintWriter writer = null;
      try {
      writer = new PrintWriter(path);
      } catch (FileNotFoundException e) {
      e.printStackTrace();
      }


      // sets up creating the document
      myDoc.encoding(Encoding.UTF_8); //or ISO8859-1. Default is UTF-8
      addTitlePage(myDoc);
      addContent(myDoc);

      String myWord = myDoc.getContent();

      writer.println(myWord);

      Delete
  2. Thanks for the feedback. Feel free to send PR's to the project on Github. We are looking at maintainers to take over the project as I am a front-end dev now.
    Leonardo

    ReplyDelete