Search:

Type: Posts; User: javapenguin

Search: Search took 0.11 seconds.

  1. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Ok, this time it's relative to the animator object.

    Thanks.

    >:D<>:D<>:D<>:D<
  2. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    I tried the old code, but am not sure how to apply it to the animator object only.

    Right now it will just show the position of the mouse on my screen, even outside any components.
  3. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Yeah, but when I put it in the Component, it still says null.
  4. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Yes, the other code that involved the MouseInfo class did work, but I wasn't looking for the mouse position on my computer screen. Just the mouse position on the FountainAnimator object.
  5. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    It appears that animator.getMousePosition() is returning null so that's what's causing the exception.

    But what do I do then?
  6. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JOptionPane;
    import java.util.*;
    import java.io.*;
    import javax.swing.Timer;
    import...
  7. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Ok, the Component method of

    getMousePostion().get(X) is out too apparently. It's just causing a Null Pointer Exception.

    Should I try using a MouseEvent object or will that not work either?
  8. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Ok, but how do I get it to show the position relative to the Mouse location on FountainAnimator?

    So far it's just showing the location relative to the screen.
  9. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Yep, that kinda would explain a lot.

    However, why isn't my JLabel breaking into lines apart with the <br> code?

    Now the Mouse Locator is working!

    But why is the <br> still literally there...
  10. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Wait a minute.....

    #-o#-o#-o#-o

    I never started the Timer, did I?
  11. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    sml = new ShowMouseLocation();
    sml.setVisible(true);

    aTimer = new Timer(0,sml);
    aTimer.setDelay(100);


    Should be working correctly, but it...
  12. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Ok, I fixed the window problem(I think) and now it will exit on close.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JOptionPane;
    import...
  13. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    I don't need a MouseListener apparently.

    MouseInfo class should work instead. However, Norm can't seem to get it to maximize the window.

    I don't know what's causing that either.

    I can...
  14. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    It is working.

    It just starts out minimized.

    I don't know what's causing that either.

    Can't fix that.

    Try enlarging it.
  15. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    I printed out the values already and they indicate that the mouse is always at 0.0, 0.0.

    Here, I've made the program shorter to get at the problem quicker:

    import java.awt.*;
    import...
  16. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    I tried the code JavaPF suggested but it's not working.

    In fact, it's not displaying anything at all now.

    What I'm trying to do is use a Timer on the FountainAnimator class to keep repainting...
  17. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    I had a larger program that DID compile. However, after being told again and again and again and again to make a SSCEE I decided to remove all the parts that weren't relevant to the problem.

    I...
  18. [SOLVED] Re: Why isn't the MouseListener showing the X and Y cords like I want it to?

    Why are all of these component's on the editor weird?

    Also, the smiles are limited and there is a message popping up in yellow every once in while while I type that says "Auto-Saved" that I...
  19. [SOLVED] Why isn't the MouseListener showing the X and Y cords like I want it to?

    It should work. I have a MouseListener and I told it to make a new window that will show, in brackets which it's not, the point where the mouse is on the first window. Well, I have a hard time...
Results 1 to 19 of 19