Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Java by fail ( 11 years ago )
package app;
import java.awt.FlowLayout;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import javax.swing.JFrame;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.ToolTipManager;
public class Main {
public static void main(String[] args) {
ToolTipManager ttm = ToolTipManager.sharedInstance();
ttm.setInitialDelay(0);
JFrame win=new JFrame();
win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
win.setSize(400, 300);
win.setLayout(new FlowLayout());
final JProgressBar jp=new JProgressBar();
jp.addMouseMotionListener(new MouseMotionListener() {
public void mouseMoved(MouseEvent e) {
jp.setToolTipText(Math.random()+"");
}
public void mouseDragged(MouseEvent e) {
}
});
win.add(jp);
win.setVisible(true);
Timer t = new Timer(1000, new ActionListener() {
public void actionPerformed(ActionEvent e) {
jp.setToolTipText("fail");
Point locati
Point locati Point(locationOnScreen);
SwingUtilities.convertPointFromScreen(locationOnComponent, jp);
ToolTipManager.sharedInstance().mouseMoved( new MouseEvent(jp, -1, System.currentTimeMillis(), 0, locationOnComponent.x, locationOnComponent.y,
locationOnScreen.x, locationOnScreen.y, 0, false, 0));
}
});
t.start();
}
}
Revise this Paste