Search:

Type: Posts; User: crzybldthrwr

Search: Search took 0.06 seconds.

  1. Re: Add drawing function MouseMotionEventListener program?

    Ahhh I see what you mean! Ok now that I got this to work I'm pretty sure I can add some basic mouse painting functions without too much issue!

    Thanks Norm!
  2. Re: Add drawing function MouseMotionEventListener program?

    Wait a sec, where is the paintComponent method being copied to?
  3. Re: Add drawing function MouseMotionEventListener program?

    Ah ok i'll do that, be back in a sec!
  4. Re: Add drawing function MouseMotionEventListener program?

    but where am I copying the drawstring code to?
  5. Re: Add drawing function MouseMotionEventListener program?

    I'm thinking the issue is because I'm creating that new MyPanel, so it just throws that new 450,450 area in the next available slot
  6. Re: Add drawing function MouseMotionEventListener program?

    public MouseMotionEventDemo() {
    super(new GridLayout(0,1));
    blankArea = new BlankArea(Color.YELLOW);
    add(blankArea);

    textArea = new JTextArea();
    ...
  7. Re: Add drawing function MouseMotionEventListener program?

    I got it to work in post 21 :)
    But i'd still like the text to be drawn inside the yellow area
  8. Re: Add drawing function MouseMotionEventListener program?

    1400

    so here i'd want it to be in the yellow area
  9. Re: Add drawing function MouseMotionEventListener program?

    Edit: nevermind I recopied the code from post 12 and it works just like you showed, but Id like the text to be IN the area above the box that shows the coords
  10. Re: Add drawing function MouseMotionEventListener program?

    in the public void paintComponent I have the drawString try to draw "Custom Panellll" at 100,200
  11. Re: Add drawing function MouseMotionEventListener program?

    Yup that solved the error! But now that it runs, the text that i have it drawing doesn't show up?



    /*
    * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
    *
    *...
  12. Re: Add drawing function MouseMotionEventListener program?

    The error is "C:\Users\Chris\Desktop\events-MouseEventDemoProject\events-MouseEventDemoProject\src\events\MouseMotionEventDemo.java:102: error: non-static variable this cannot be referenced from a...
  13. Re: Add drawing function MouseMotionEventListener program?

    I read that and am working through it, this is what I have so far and I'm getting an error on "frame.add(new MyPanel());"

    The error is "non-static variable this cannot be referenced from a static...
  14. Re: Add drawing function MouseMotionEventListener program?

    I'm pretty sure my paint and drawCoordinates functions are completely wrong, I was just trying things to get it to work

    EDIT: heres the BlankArea.Java code, this is needed also



    package...
  15. Re: Add drawing function MouseMotionEventListener program?

    package events;

    /*
    * MouseMotionEventDemo.java
    *
    */

    import java.awt.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
  16. Re: Add drawing function MouseMotionEventListener program?

    void eventOutput(String eventDescription, MouseEvent e) {
    textArea.append(eventDescription
    + " (" + e.getX() + "," + e.getY() + ")"
    + " detected on "
    ...
  17. Re: Add drawing function MouseMotionEventListener program?

    Should I post the full code of both java files? One just sets the blank area for the applet and the other does all the dirty work
  18. Re: Add drawing function MouseMotionEventListener program?

    I posted the code in the links, I took out my code because it was basic java stuff, using Graphics G and drawLine using the previous X,Y coords and the current ones
  19. Add drawing function MouseMotionEventListener program?

    Posting this again since my original post accidentally got removed!


    So I'm using these 2 pre-written demo-files:
    Java Tutorials Sample Code
    Java Tutorials Sample Code

    if you go to this...
Results 1 to 19 of 19