Java paint graphics generator

Posted on 2005-04-24
Last Modified: 2012-06-27
Hi everybody,

I'm currently working with applet and needs to make a lot of graphics, so I just wanted to know if anyone had a porgram that let the user paints and then generates the code of the graphics.

Thanks for your help,

Question by:The_Kingpin08
    LVL 86

    Expert Comment

    Is this the sort of thing you mean?
    LVL 86

    Expert Comment

    Here's another drawing applet:

    Author Comment

    This is kind of what I'm looking for, except that when I have made all my graphics, I'd like to be given the code of those graphics...

    ie. If I draw 4 rectangles and a circle, I'd like to have something like:

    g.drawRect(10, 90, 150, 100);
    g.drawRect(40, 120, 150, 100);
    g.drawRect(70, 150, 150, 100);
    g.drawRect(100, 1800, 150, 100);
    g.drawOval(180, 20, 260, 80);


    Thanks, Frank
    LVL 86

    Expert Comment

    You need to save each Shape into a collection each time drawing takes place. Can you just post the part of your code where that happens?

    Author Comment

    well I haven't done anything yet...

    When I did some Java back in college, I use to have a small application that would let me draw some shape and generate the Applet code once I was done. That's exactly what I would need, since I would have all my shapes already and would only have to add some code.

    Don't know if I'm being clear, but I'm looking for a way to avoid losing time with the graphics...

    Thanks, Frank
    LVL 15

    Accepted Solution

    There are many WYSIWYG for generating Java code to create forms, but I don't know of any that can generate code for graphics.
    Also, if there was one It would probably not generate the code based on a given image.
    Java 1.1 graphics are very simple to use (see this short tutorial to prove it:
    Going further to the Java2D graphics can be more complex but still not that bad:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

    Title # Comments Views Activity
    VB Script 3 60
    how to extract window origin in spring 2 55
    squareUp  challenge 22 80
    mapAB Challlenge 35 46
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    This video teaches viewers about errors in exception handling.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now