Results 1 to 7 of 7
  1. #1
    Fondor is offline Member
    Join Date
    Apr 2010
    Posts
    10
    Rep Power
    0

    Default Help Creating Custom File and Adding an Editor

    I am creating a program for a friend. It is a "Quilt Designer" program. The program allows you to design (draw patterns, blocks, and quilts and add color to them) quilts and patterns ext. First, I would like to know if there is some kind of JPane, or box that I can be used to draw onto.

    I also would like to know how to save them as a file.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    You may wish to look into drawing onto a BufferedImage object, displaying this in a JPanel's paintComponent method (check out Graphics#drawImage(...)), and then saving it with the help of one of the static ImageIO.write(...) overloads.

  3. #3
    Fondor is offline Member
    Join Date
    Apr 2010
    Posts
    10
    Rep Power
    0

    Default

    Sorry, I forgot to mention.... would you be able to load it back into the editor? I would like for the user to be able to save it as a project and come back to it. Would this method work?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Depends. If you just want to save and reload the image, no problem. If on the other hand you want to save the logic used to draw the image (filled ellipse here, drawn circle there), then you would have to go another route, perhaps using Serialization.

  5. #5
    Fondor is offline Member
    Join Date
    Apr 2010
    Posts
    10
    Rep Power
    0

    Default

    How would you use this.... sterilization method? Yes, I would like the users to be able to edit it.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Fondor View Post
    How would you use this.... sterilization method? Yes, I would like the users to be able to edit it.
    GIYF: Java Serialization Tutorial

  7. #7
    Fondor is offline Member
    Join Date
    Apr 2010
    Posts
    10
    Rep Power
    0

Similar Threads

  1. AutoCompile in Eclipse Custom Editor
    By SSG_JJV in forum Eclipse
    Replies: 2
    Last Post: 01-29-2009, 05:09 AM
  2. Replies: 0
    Last Post: 12-17-2007, 10:46 AM
  3. Adding custom highlight to JEditorPane
    By andrewb in forum AWT / Swing
    Replies: 0
    Last Post: 06-22-2007, 07:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •