Mouse « Dialog « Java Swing Q&A





1. Mouse wheel not scrolling in JDialog but working in JFrame    stackoverflow.com

I'm facing a frustrating issue. I have an application where the scroll wheel doesn't work in a JDialog window (but works in a JFrame). Here's the code:

import javax.swing.*;
import java.awt.event.*;

public class Failtest extends ...

2. How to reduce Java Swing jitter/flicker/shake when moving dialog with MouseListener/MouseMotionListener?    stackoverflow.com

I built a Java Swing dialog with no decoration. I have implemented dialog move using drag/drop with the MouseListener and MouseMotionListener interfaces. However, during testing, the dialog flickers/jitters/shakes when moving. ...

3. Register MouseListener's mouseExited to JDialog or JFrame    coderanch.com

import javax.swing.JPanel; import javax.swing.JTabbedPane; public class TestFrame extends javax.swing.JFrame { public TestFrame() { JTabbedPane jTabbedPane1 = new JTabbedPane(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("TestFrame"); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { System.out.println("Mouse has exited the frame"); } }); getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER); pack(); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new TestFrame().setVisible(true); } }); } }

4. get jdialog's new location after mouse drag    coderanch.com

im trying to get a jdialog's new location after a mouse drag. but my current code does not work. the jdialog added the mousemotion and mouselisteners and it only works if the mouse events are within the jdialog's contentpane area. if i drag the titlebar, nothing happens. i dont see any way to get the titlebar object in the api. anyone ...