Get Mouse Position

MouseInfo.getPointerInfo().getLocation() might be helpful. It returns a Point object corresponding to current mouse position.

Popup Message boxes

javax.swing.JOptionPane Here is the code to a method I call whenever I want an information box to pop up, it hogs the screen until it is accepted: The first JOptionPane parameter (null in this example) is used to align the dialog. null causes it to center itself on the screen, however any java.awt.Component can be … Read more

Javac “cannot find symbol”

First, To compile the java source file using javac you need to specify the files to compile explicitly. Example: you need not provide the path if the source file is in the current working directory. Second, whenever java encounters import abc.xyz.ClassName; it tries to resolve abc/xyz/ClassName with respect to the classpath or current working directory. … Read more

What does it mean: The serializable class does not declare a static final serialVersionUID field? [duplicate]

From the javadoc: The serialization runtime associates with each serializable class a version number, called a serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization. If the receiver has loaded a class for the … Read more

unexpected type error

The problem is here: The left-hand-side is a value. Not a variable. That’s why you can’t to a += to it. Although it defeats the purpose of learning how do it the hard way, you can do it like this:

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)