Generic stack implementation

The underlying issue is type erasure. The relevant implications of this means that an instance of the Stack class doesn’t know it’s type arguments at run-time. This is the reason why you can’t just use the most natural solution here, array = new T[maxSize]. You’ve tried to work around this by creating an array using … Read more

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

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