import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
/**
* Sourced from Oracle and adapted
public static void main(String[] args)
{
- /* Use an appropriate Look and Feel */
- try
- {
- // UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
- // UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
- UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
- } catch (UnsupportedLookAndFeelException ex)
- {
- ex.printStackTrace();
- } catch (IllegalAccessException ex)
- {
- ex.printStackTrace();
- } catch (InstantiationException ex)
- {
- ex.printStackTrace();
- } catch (ClassNotFoundException ex)
- {
- ex.printStackTrace();
- }
- /* Turn off metal's use of bold fonts */
- UIManager.put("swing.boldMetal", Boolean.FALSE);
// Schedule a job for the event dispatch thread:
// creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable()
void logEvent(String eventDescription, MouseEvent e)
{
- // textArea.append(eventDescription + " detected on "
- // + e.getComponent().getClass().getName() + "." + NEWLINE);
log("------- " + counter++ + ": " + eventDescription);
log("e.isPopupTrigger: " + e.isPopupTrigger());
log("SwingUtilities.isRightMouseButton: "
@Override
public void mouseEntered(MouseEvent e)
{
- // eventOutput("Mouse entered", e);
}
@Override
public void mouseExited(MouseEvent e)
{
- // eventOutput("Mouse exited", e);
}
@Override