
-----------------------------------
ify
Sat Jun 05, 2004 12:41 pm

a different way to do graphics other than canvas
-----------------------------------
here is a frame layout for a program i find it simpler than canvas





// The "FrameApp" class.
import java.awt.*;

public class FrameApp extends Frame
{
    public FrameApp ()
    {
        super ("FrameApp");     // Set the frame's name
        setSize (400, 400);     // Set the frame's size
        show ();                // Show the frame
    } // Constructor
    
    public void paint (Graphics g)
    {
        // Place the drawing code here
    } // paint method
    
    public static void main (String[] args)
    {
        new FrameApp ();        // Create a FrameApp frame
    } // main method
} // FrameApp class



you place all of the image/drawring in the paint  method hope this helps someone  :D [/b]

-----------------------------------
ify
Sat Jun 05, 2004 12:50 pm

and.....
-----------------------------------
by image and drawring i mean  g.drawRect(x,y,width,height)  , and stuff like that and there will probably be filcker such as in this program

[code]// The "Final" class.
import java.awt.*;

public class Final extends Frame
{
    int ballX = 50;
    int ballY = 200;
    int xTwenty = 20;
    int yFive = 5;
    int playerX = 200;
    int mouseMoved = 0;
    //  Image offScreenImage;
    //Graphics offScreenBuffer;
    public Final ()
    {
        super ("Final");  // Set the frame's name
        setSize (400, 400);     // Set the frame's size
        setBackground (Color.black);
        show ();                // Show the frame
        // Constructor

    }



    public boolean mouseMove (Event event, int x, int y)
    {
        if (x >= 30 || x  340)
        {
            xTwenty = -xTwenty;

        }


        else if (ballY < 50 || ballY > 350)
        {
            yFive = -yFive;

        }
        else if (ballX = playerX && ballY >= 310 && ballY = 30 || x  340)
        {
            xTwenty = -xTwenty;

        }


        else if (ballY < 50 || ballY > 350)
        {
            yFive = -yFive;

        }
        else if (ballX = playerX && ballY >= 310 && ballY 