Is there a good framework for Java desktop applications? [closed]

i asked a similar question some time ago, see Swing desktop-development if you are interested. My conclusion was/is that there simply are no frameworks that can do for your desktop-application, what any of the bazillion great WEBframeworks can do for your webapplication. It seems absurd, but in my experience due to the great web-frameworks and … Read more

How do I close a JDialog and have the Window Event Listeners be notified?

Closing a window (with dispose()) and hiding it (with setVisible(false)) are different operations, and produce different events — and closing it from the operating system is yet another different operation that produces yet a different event. All three will produce windowDeactivated to tell you the window’s lost focus, but dispose() will then produce windowClosed, while … Read more

What is ‘JNI Global reference’

A JNI global reference is a reference from “native” code to a Java object managed by the Java garbage collector. Its purpose is to prevent collection of an object that is still in use by native code, but doesn’t appear to have any live references in the Java code. A JFrame is a java.awt.Window, and … Read more

Stop a swing Timer from inside the Action Listener

Also possible: final Timer timer = new Timer(10, null); timer.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { (as in the question, except that you can refer to timer here) } }); Or, use the event object to get the source (and cast it, boo): final Timer timer = new Timer(10, new ActionListener() { public void … Read more

Difference between paint, paintComponent and paintComponents in Swing

AWT, override paint(). Swing top-level container (e.g.s are JFrame, JWindow, JDialog, JApplet ..), override paint(). But there are a number of good reasons not to paint in a TLC. A subject for a separate question, perhaps. The rest of Swing (any component that derives from JComponent), override paintComponent(). Neither override nor explicitly call paintComponents(), leave … Read more

How can I listen for key presses (within Java Swing) across all components?

It is possible. KeyboardFocusManager.getCurrentKeyboardFocusManager() .addKeyEventDispatcher(new KeyEventDispatcher() { @Override public boolean dispatchKeyEvent(KeyEvent e) { System.out.println(“Got key event!”); return false; } }); That will grab all key events. Returning false allows the keyboard focus manager to resume normal key event dispatching to the various components. If you want to catch key combos, you can keep a set … Read more

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