Java Code Examples for javax.swing.JEditorPane#addMouseMotionListener()
The following examples show how to use
javax.swing.JEditorPane#addMouseMotionListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutoHidingMenuBarManualTestApp.java From netbeans with Apache License 2.0 | 6 votes |
private void initComponents() { addFakeMenuItems(); frame.setJMenuBar(mainMenuBar); frame.setSize(400, 280); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); JEditorPane pane = new JEditorPane(); // Make sure that consumed events do not cause problems. pane.addMouseMotionListener(new MouseMotionAdapter() { }); frame.add(pane, BorderLayout.CENTER); frame.add(new JLabel("This is a label"), BorderLayout.SOUTH); /* Simulate a full-screen window so that the very top (y=0) of the JFrame can receive mouse motion events. The Window will end up aligned to the top of the screen. */ frame.setUndecorated(true); new AutoHidingMenuBar(frame).setAutoHideEnabled(true); }
Example 2
Source File: LanguagesEditorKit.java From netbeans with Apache License 2.0 | 5 votes |
public @Override void install (JEditorPane c) { super.install (c); HyperlinkListener hl = new HyperlinkListener (); c.addMouseMotionListener (hl); c.addMouseListener (hl); c.addKeyListener(hl); c.addCaretListener (new MarkOccurrencesSupport (c)); }
Example 3
Source File: SwingBoxEditorKit.java From SwingBox with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void install(JEditorPane c) { super.install(c); c.addMouseListener(mcontroller); c.addMouseMotionListener(mcontroller); component = c; }