Ok, this time it's relative to the animator object.
Thanks.
>:D<>:D<>:D<>:D<
Type: Posts; User: javapenguin
Ok, this time it's relative to the animator object.
Thanks.
>:D<>:D<>:D<>:D<
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.
Yeah, but when I put it in the Component, it still says null.
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.
It appears that animator.getMousePosition() is returning null so that's what's causing the exception.
But what do I do then?
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...
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?
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.
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...
Wait a minute.....
#-o#-o#-o#-o
I never started the Timer, did I?
sml = new ShowMouseLocation();
sml.setVisible(true);
aTimer = new Timer(0,sml);
aTimer.setDelay(100);
Should be working correctly, but it...
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...
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...
It is working.
It just starts out minimized.
I don't know what's causing that either.
Can't fix that.
Try enlarging it.
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...
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...
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...
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...
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...