Double click of JTextPane does not get through

Hi everybody,
I add a mouse listener to my JTextPane. This mouse listener just prints out the clickcount of the mouse event:
private class TitleMousListener extends MouseAdapter
    * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
   public void mouseClicked(MouseEvent e)
      logger.info("====== TitleMouseListener");
      logger.info("is consumed: " + e.isConsumed() + ", click count: " + e.getClickCount() + ", right button: "
            + (e.getButton() != MouseEvent.BUTTON3));
}Somehow the e.getClickCount() is always 1, even if I doubleclick on the JTextPane.
How can I catch the double clicks of the JTextPane?
Best regards,
Jethro

Hi,
I can't reproduce that behaviour. The e.getClickCount() is 1 AND 2.
I used the following code with jdk1.6:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MainDialog extends JDialog {
    public static void main(String[] args) {
        MainDialog dlg = new MainDialog();
        dlg.setSize(400, 400);
        dlg.setLocationRelativeTo(null);
        dlg.setVisible(true);
    JPanel panel1 = new JPanel();
    BorderLayout borderLayout1 = new BorderLayout();
    JPanel jPanel1 = new JPanel();
    JScrollPane jScrollPane1 = new JScrollPane();
    JTextField jTextField1 = new JTextField();
    JTextPane jTextPane1 = new JTextPane();
    TitleMousListener listener = new TitleMousListener();
    public MainDialog() {
        super(new Frame(), "MainDialog", false);
        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        panel1.setLayout(borderLayout1);
        jTextField1.setText("jTextField1");
        jTextPane1.setText("jTextPane1");
        getContentPane().add(panel1);
        panel1.add(jPanel1, java.awt.BorderLayout.NORTH);
        jPanel1.add(jTextField1);
        panel1.add(jScrollPane1, java.awt.BorderLayout.CENTER);
        jScrollPane1.getViewport().add(jTextPane1);
        jTextField1.addMouseListener(listener);
        jTextPane1.addMouseListener(listener);
        pack();
    private class TitleMousListener extends MouseAdapter {
        public void mouseClicked(MouseEvent e) {
            System.out.println("TitleMouseListener");
            System.out.println("is consumed: " + e.isConsumed() + ", click count: " + e.getClickCount() + ", right button: "
                               + (e.getButton() != MouseEvent.BUTTON3));
}Does that work for you?
- Michael

Similar Messages

  • Double click select all does not work in web site's search area after going back.

    After updating from Firefox ESR v24.8.1 to v31.20 double click select all does not work in a search area after going back or searching again with the same input. It happens before clicking search icon and searching for something else double click select all does not work except it works for one word that's all.
    This issue is with all new Firefox ESR and None ESR I have tried. Also the issue is on all web sites like www.softpedia.com for example.

    Bugzilla has a different login system, unfortunately.

  • Double click home button does not bring up Search

    I installed OS 3.0 on my first generation iPod Touch. On the Settings | General | Home, I selected Search. When I double click the home button, I get the "Dock Connector" dialog. Am I missing something?

    RESOLUTION- First, enter "Settings" and select "General". Then, scroll down to "Home". Then, flip the switch that says "iPod Controls" (so it is off). Once your are done with that, select what you want a double-click of the Home button to be.
    Copied from another message

  • CS5: double-click on file does not open the file

    If Photoshop is closed, double-click on a file will always successfully launch Photoshop and open the picture.
    If Photoshop is running, double-clicking on a file will activate Photoshop, but very often the file does not open. It works from time to time though, and that seems to be on a random basis.
    Opening a file through the Open command will always work.
    I am working with 10.6.3 on a loaded Mac Pro.
    Did anybody experience this difficulty? Any help would be appreciated, before I take more drastic measures like reinstalling the software of worse than that. I've already done the usual maintenance operations.

    Marian Driscoll wrote:
    Caustic waltz, while brief, may have hit the nail on the head. If you do not want to continue this thread, you can search the forum for existing posts about Snow Leopard and file-program association confusion. Snow Leopard changed some things and that might be your issue.
    More simply, do your image files have extensions? (.PSD, .JPG, etc...)
    Hello Marian:
    While browsing through my Adobe account, I saw that you took the time to leave a comment two days ago. While it did not solve my problem, I will mark your comment as "helpful" for several reasons. It could have been a cause. And I will add politeness, courtesy and language precision. I'm an old guy and I quite value those elements.
    True, Snow Leopard changed changed the way files are associated to applications. Thank God! Here in our small office, we do a lot of cross-platform transfers and finally it works seamlessly. A good description of the new file identification system can be found here.
    Now, here are the reasons why Snow Leopard cannot be put at fault in my case:
    • If Photoshop CS5 is not launched, double-clicking on any psd, tiff or jpeg file will launch it and open properly.
    • If Photoshop CS5 is already running, double-clicking on any psd, tiff, or jpeg file will activate Photoshop CS5 but will not open.
    This points at either a bug or damaged Photoshop CS5, or maybe a damaged OS. Don't forget that out of maybe a hundred apps, this is the first time I meet with that problem. Of course, the easier course, but by no means guaranteed to work, is to presume that Photoshop CS5 is damaged or that its installation did not work properly. So I did the following things:
    • I deactivated Photoshop CS5 and uninstalled it.
    • I ditched all remaining files related to CS5, CS4, CS3, CS2, CS... yes I know, but then you know as well as I do0 that getting really rid of Photoshop is a daunting task. It took me almost two hours, but I am reasonably sure that the cleaning job was complete.
    • I reinstalled Photoshop CS5.
    Now everything works just fine at least for the time being. Time will tell, of course, but I think that the problem is solved.
    Regards

  • Scanner error 6: HP LaserJet Pro 400 color MFP M475dw does not get through initialization phase

    My lJ400 MFP475 detects a problem with the scanner unit after chewing on it for several minutes and never finishes intitialization. Initially you can hear the scanner head move softly, but after less than a minute it starts rattling at the end of every move.
    After a few minutes I get the message "Scanner error 6, Turn off then turn on".
    I did that, again and again. Also with cables removed, waiting for some time etc.
    In the Event log I can see the following:
    Entry # Code Page Description
    10 54.2100 1035 BD error
    9 54.2100 1023 BD error
    8 54.2100 1016 BD error
    7 54.2100 1015 BD error
    6 54.2100 1014 BD error
    5 54.2100 1011 BD error
    4 54.2100 887 BD error
    3 41.3000 260 Unexpected Paper Size
    2 54.2100 43 BD error
    1 54.2100 39 BD error
    I have used this MFP sparingly and am only halfway the first set of color toner cartridges, so I'm a bit disappointed about how quickly this printer gives up. My previous printer was an Apple Laserwriter Select 360 that lasted for 20 years (no, I'm not kidding, bought it in 1993).
    Any clue?

    Hello Nazdrovje,
    Welcome to the HP Forums.
    To get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial product. You can do this at Commercial Forums.
    Thanks for your time.
    Cheers,  
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • System keeps looking for a 'server' that does not exist. Is says the old name of my Airport Extreme. Clicking it away (4x) it gets through.

    System keeps looking for a 'server' that does not exist. Is says the old name of my Airport Extreme. Clicking it away (4x) finally  gets through.

    Other weirdness to report: my neighbor upstairs appears to have a Linksys router network on channel 6. My AEBS is on channel 1 so there shouldn't be interference... but according to iStumbler sometimes the signal leaps to 64000 (keep in mind my own Airport never tops 60)! Is that potentially the problem?
    Might it be possible that your neighbor just acquired a 802.11n (pre-N) wireless router recently?
    802.11n effectively increases capacity by doubling the number of Wi-Fi radios and increasing the number of antennas used to push signals out of those radios. 802.11n splits a data frame into multiple pieces. It then transmits these pieces in parallel using multiple radios that are attached to multiple antennas. These antennas blast out signals from virtually the same vantage point – scattering the signals everywhere.
    You may find the following ZDNet article interesting: http://blogs.zdnet.com/Ou/?p=247
    Even if he did not, and you are on good terms, you might want to ask if he can temporarily turn off his wireless, or, at least, reduce the signal strength to see if that will help in your situation.

  • After upgrading to Maverick, when I double click on the attchment I get this message "...could not be saved, because you cannot change the contents of that fold

    After upgrading to Maverick, when I double click on the attachment I get this message "...could not be saved, because you cannot change the contents of that folder. Change the folder properties and try again, or try saving in a different location." It happens for all types of files.
    Any suggestions as how to fix this?
    I'm on a Mac OS X 10.9.3 with Thunderbird 24.5.0

    Thunderbird > preferences (I think on a mac) and under attachments set the folder

  • Until recently I was able to send images in the body of my Yahoo emails. Now, I am getting the message "This message has been truncated", and the email does not go through. I do not have this problem using IE. Could you please help? Thank you.

    Until recently I was able to send images in the body of my Yahoo emails. Now, I am getting the message "This message has been truncated", and the email does not go through. I do not have this problem using IE. Could you please help? Thank you.

    Try this -> http://support.apple.com/kb/TA38632?viewlocale=en_US

  • Tried syncing entire music library to ipod but some albums were skipped.  tried click and drag album but device does not get highlighted when i drag album there. any suggestions?

    I tried syncing entire music library to ipod.  some albums were skipped.  tried clicking and dragging but device does not get highlighted when i drag the album to the device. How can I sync album to ipod?  the album is imported and not purchased thru itunes store.

    Does it play in iTunes on the computer? What is the format of the album?
    Right click and select Get Info. Look under File in iTunes 12

  • SP1 does not get installed when the machine is set to Japanese Language, software push through sccm 2012

    Hi,
    Please help me with the below issue, iam trying to deploy Service pack 1 on Windows 7 , 32 Bit OS
    SP1 does not get installed when the machine is set to Japanese Language, software push through sccm 2012 , it does gets installed of installed manually, by remoting into the machine
    also it gets installed through sccm when the machine is set to english language, 
    Thank you
    Tanoj
    OSLM ENGINEER - SCCM 2007 & 2012

    Hi Friends,
    we are deploying the SP1 via SCCM 2012 , and the success rate is around 50 %, its a Light touch installation where user will initiate the installation via Software Center ( Web based )
    i was able to gather few errors , and this are the errors which failed during SP1 Installation 0x800f0828,
    some errors which sccm reports display are 
    11171
    10008
    10021-
    17031 - 
    1602 - User Cancelled installation
    113 - No more internal file identifiers available
    10070 - File handle reference is no longer available
    10050 - A socket operation encountered a dead network
    11170  - The task sequence manager could not successfully complete execution of the task sequence
    i could not find the reason for some of the errors, also i am looking for a fix/woraround if any
    Also i have noticed that in few computers the task seq failed at a place where after the sp1 installation a reboot happens and then PGP BYPASS utility is uninstalled, it did not start the PGP bypass uninstall after reboot
    is there a way to cut short the Task seq and keep it simple ?
    right now its like this 
    1. checking for prerequisite : checks for OS Name and OS version
    2. installs PGP Bootgaurd Bypass
    3. System Restart
    4. Installing Windows 7 Service Pack 1
    5. Final Restart
    6. uninstall PGP Bootgaurd Bypass
    Regards
    Tanoj
    OSLM ENGINEER - SCCM 2007 & 2012

  • I cannot get my itunes library to sync on to my ipod.  Every time I click sync, it does not.

    I cannot get my itunes library to sync on to my ipod.  Every time I click sync, it does not.

    What exactly happens when you try to sync?
    Was the iPod previous synced to another iTunes library/computer?
    Have you successfully synced from this iTunes library/computer before?
    Do the songs play in iTunes?
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod        
    Try syncing using the manual method

  • User defined fields does not get added into database

    Hello Experts
                              User defined fields does not get added into database , when i click add button it
    shows data added sucessfully , but when i check data base no entry is made , only entry is made for
    B1 fields , like DocEntry ,DocNum etc.., no entry is made for U_fields..
    I have check every thing databound is also set to true
    Actually first few 6 data was added properly but now its not geeting added for user fields
    I have used 2 document row  child table for 2 matrix and for remaining Document table
    What might be the problem
    reply soon
    plz suggest

    Hello sir
    I have checked Default form , in that entry is made into database
    but running the form in screen painter in preview mode or through coding it does not get added for user field
    this id my binding code
    LoadFromXML("updateopd.srf")
                oForm = SBO_Application.Forms.Item("updopd")
                oForm.DataBrowser.BrowseBy = "txtpatid"
                'Adding combo in Obervation
                oItem = oForm.Items.Item("txtpatid")
                oEdit2 = oItem.Specific()
                oEdit2.DataBind.SetBound(True, "@UPDATE", "U_PID")
                oItem = oForm.Items.Item("txtmnane")
                oEdit3 = oItem.Specific()
                oEdit3.DataBind.SetBound(True, "@UPDATE", "U_FName")
                oItem = oForm.Items.Item("txtlname")
                oEdit3 = oItem.Specific()
                oEdit3.DataBind.SetBound(True, "@UPDATE", "U_LName")
    Plz suggest

  • Dbacockpit overview pane does not get populated

    Hi guys,
    I have already gone through the several other threads on sdn which repeat the same issue here but I am not able to find a solution via them. Can any one give me some leads into this...
    -- CHANGES DONE --
    We applied all relevant support packs which were part of Support stack 13. This involved also patching SAP BASIS from 10 to 13. Also NW04S 700 kernel was upgraded to patch 114 (SAPEXE and SAPEXEDB SAR packages)
    STATEMENT OF PROBLEM(S)
    Tcode dbacockpit does not refresh data in the overview pane.
    note: db02old still works and we are able to refresh stats from there but dbacockpit overiew pane does not get populated.
    Also post support packs: “sap_collector_for_performance” runs successfully but reports in job log “database system is not supported”
    When we do a refresh via dbacockpit, the job “refresh space statistics” ends with a “compute bcd overflow” dump.
    CHECKS ALREADY MADE
    --Note 1066044 – for the BCD overflow dump – does not help. We are already at BASIS pack 13 and the correction contained in the note is already in place. As
    per the note since are already at BASIS SP13 we should not be facing this. Why are we facing this then ?
    --Note 868063
    Call report rsoracup; put in con_name=DEFAULT; operatio=CREATE;F8 – did this.
    --Note 1002840.(checks done as per note)
    a) Check if SAP_Collector_for_perfmonitor is scheduled hourly
    It completes successfully but gives job log below
    1/16/2007 12:06:14 Job started
    1/16/2007 12:06:14 Step 001 started (program RSCOLL00, variant , user ID DDIC)
    1/16/2007 12:06:14 Clean_Plan:Cleanup of DB13 Plannings
    1/16/2007 12:06:14 Clean_Plan:started by RSDBPREV on server
    1/16/2007 12:06:14 Clean_Plan:Cleaning up jobs of system xxx
    1/16/2007 12:06:14 Clean_Plan:finished
    1/16/2007 12:06:15 Database system not supported
    1/16/2007 12:06:17 Job finished
    Why ?? (we got oracle 10.2.0.2)
    b) se16 -> table TCOLL. Check if entery RSORACOL exists.
    It does exist as below
    RNAME RSORACOL
    RENUM 1
    SYTYP S
    ALTSY
    DAYOW XXXXXXX
    TIMOD XXXXXXXXXXXXXXXXXXXXXXXX
    c)SE16 -> table ORA_MON_DBCON. Check for enrry con name: DEFAULT.
    It does exist as below
    CON NAME DEFAULT
    STATUS A
    MAX RUNTIME 1,800
    MAX UPLOAD 1,000,000
    LOG LIFE 100
    DESCRIPTION Local database. R/3 system available.
    d)se16 -> table db02_coll_plan. Check if all the entries have status A and there are 64 entries. This is ok
    --Note 1042725
    SE16-> PROGDIR for Name= 'LSDBORA3F03'; Set field EDTX to blank
    All entries have EDTX blank but there is no entry 'LSDBORA3F03’
    Despite all the above checks I am unable to get the dbacockpit to refresh. Does anyone have any ideas. Will putting in the latest DBSL shared library patch for oracle solve this... I did SAPEXE and EXEDB.SAR latest. Any ideas...?
    Cheers, Vikram
    [email protected]

    For this issue it's still not working for me in Sanbox BI. I got a SAP message open for this. But I got it to work on Dev and TST systems. There was one mistake I was making. This may not be the cause though but just for your info. When we go to dbacockpit, click on collector setup icon. And there when we give connection name = "default" and then action as "create connection", I was not saving the variant. Click save and give a name to the variant like "refresh stats" or something. Then click refresh icon so that the "Refresh space statistics" will run in background. When I saved the variant on dev and test BI I did not end with a BCD overflow dump for the  "refresh space statistics" job.The refresh space stat job needs to find the variant name.And this then populated the dbacockpit -> space -> overview pane. Although the "perf for monitor" job still has log entries "db system not supported" that doesn't matter. It's probably a message we can ignore.
    Also if you are still facing prob, check these.
    You say you are on SP12 which SP component are you referring to (stack number ?. BASIS ? BW ?). Make note I have done the support stack 13 which contains upto the BW patch upto 15 and upto BASIS patch 13. Note 1066044 says if you have BASIS 13 you won't face this problem .
    Is your "perf for collector" job running without issues. That is a prereq to the "Refresh space stats" job. Try to troubleshoot that as well. I think the refresh stats job has to find the data in table MONI which gets populated via "perf for collector" (RSCOLL00).
    regards, Vikram

  • Audigy 4 Pro - I/O Hub does not get any po

    Hello all,
    I purchased an Audigy 4 Pro a few days ago and I cannot get the external hub to power on.
    This somewhat sumarizes what I tried so far:
    . Uninstalled all drivers and software of my old Soundblaster Li've 5. Platinum
    2. Also removed all entries of the old soundcard from Device Manager
    3. Powered down the PC fully, took out the Li've 5. and powered it back on and logged on to my Windows XP (SP2).
    4. Just to be sure before installing the drivers for the Audigy 4 Pro I cleaned out the cookies, temporary internet files, all other Temp folders, the Prefetch folder and also ran a program to clean the registry.
    5. De-activated my Norton AntiVirus Corporate Edition's Real-time protection, it's services and also my ZoneAlarm Pro from starting up the next time I reboot Windows.
    6. Powered down the PC again, took the power cable out, made sure there was no power whatsoever left and carefull inserted the Audigy 4 Pro card in an empty PCI slot.
    7. Connected the larger AD_Link to the card, then to the hub
    8. Connected the smaller AD_Link to the card, then to the hub
    9. Finally connected the power convertor cable to a free systems power unit
    0. Double-checked the entire hardware setup a few times and power the PC back on
    . Windows XP detected and installed the OHCI Compliant IEEE 394 Host Controller and the 394 Net Adapter
    2. Canceled to proceed looking for a driver when it found the Audigy 4 Pro card
    3. Installed the drivers and applications that came with the Audigy 4 Pro. Everything went smooth - no error messages during the installation.
    4. Rebooted PC after prompting to do so.
    5. With ZoneAlarm and my Norton Antivirus de-activated, all drivers and programs installed properly the external I/O hub does NOT get any power. I also made sure to check this with the remote control.
    I have ofcourse no sound coming out that hub when plugging in my headphone and also cannot use my microphone.
    6. I ran the Diagnostics program that was installed automatically with the other Creative applications: It claims there aren't any problems.
    7. Powered down the PC again, checked all connectors, powered the PC up again: Same problem... no power.
    8. Installed the latest 4-in- drivers found on viaarena.com: Same problem
    9. Uninstalled and reinstalled the drivers and applications: Same problem
    20. Uninstalled and reinstalled the drivers and applications after taking out all other PCI cards and placing the Audigy 4 Pro card into an other PCI slot: Same problem
    2. Set my BIOS to factory defaults: Same problem
    22. Formatted the PC and reinstalled Windows XP (SP) with every update thinkable... Same problem
    23. Formatted the PC AGAIN ( ! ) and reinstalled Windows (SP2) with updates .... Same problem
    Another problem: Sent a detailed e-mail to Creative Support Europe.... Still NO respons after 48+ hours.
    Anyone else should have a solution I would appreciate trying out, or if all fails I'll go for a Terratec model.
    Thanks in advance!
    PC Stats: Asus A7V266 - VIA KT266 Chipset (VT8366 North Bridge with VT8233 South Bridge) / BIOS version: 0 / AMD Athlon .4GHz / 52Mb
    Message Edited by HilTek on 07-05-2005 :04 PM

    Amazing, I got mine about 3 days ago and have been pulling my hair out trying to resolve the same problem. I have checked power connections, reinstalled drivers. I think something is wrong with the box. I tried to call support yesterday, which was a Saturday, but they aren't available til Monday. I guess I will call them Monday. Let me know if you find anything out in the mean time.
    Thanks
    John
    AMD Athlon(tm) 64 FX-57 Processor
    A8N-SLI Premium
    NVIDIA GeForce 7800 GTX
    GB RAM
    WIN Pro x64

  • Preview List Does Not Appear through VPN

    This is an issue that IT and I worked on for a couple of weeks that turned out to have a very simple cause and an easy solution, so I thought it might help others to post the experience here.
    Environment:  Dreamweaver CS3 running on a decent laptop that sits in a docking station at work with two monitors and just sits in my lap as a laptop when working from home over a Cisco AnyConnect VPN connection.  I was trying to work from home for the first time, so it was not a case of something working before and then breaking--this issue was there all along.  The rights to the laptop are far less than Admin.  Using a strong wireless connection at home to a reliable cable ISP.
    Symptoms:  DW works fine at the office, but when I would take my laptop home and connect via VPN, the synchronize behavior was different.  Whenever I would do a synchronize/get or a synchronize/put on a file or folder which I knew had been changed by my team-mate, the Preview window would not show up as expected, listing the files that would be changed.  My team-mate did not have this issue when working from home.  Interestingly, when I did a sync/get or sync/put on a folder or file that I knew had not changed, the behavior was normal and I'd see the usual pop-up saying there were no changes to sync, and asking if you want to see a list to sync manually.
    Troubleshooting:  We did all kinds of troubleshooting with IT, including rebuilding my Adobe profile (renaming various Adobe folders in the file system and in the Windows registry to be automatically rebuilt by the program), comparing all DW settings with those of my team-mate who had no such problems working from home, pinging this server and that, adding the FTP and HTTP servers to my HOSTS file, bypassing my wifi router at home and plugging straight into the cable modem, running DW as an admin, and chasing down error messages in the Event Log.  My DW configuration mentioned something about firewall port 21, so I tried adding that to my router, hoping I was "opening" that port.  Nothing seemed to change the behavior of the Preview list not showing up when expected.
    Cause:  Eventually I had an epiphany that turned out to be right.  The problem was that I have two monitors at work, and at home I just use the laptop screen.  Nothing was actually going wrong.  But if I last had that Preview list window on the secondary screen at work, it would not appear on the laptop screen at home.  And because the Preview list window does not get a Task Bar button, I couldn't tell that it was actually "appearing" in the nonexistent secondary screen.  When the File Activity process is going, its progress indicator will have a Task Bar button, so even if it "appears" on the nonexistent screen, you can right-click the Task Bar button, select Move, and then use the arrow keys to walk that window into the visible space.
    So apparently the main DW window has code that tells it to appear on the lone screen if it was last used on a secondary screen that is now unavailable, because it always launches in a visible space.  The File Activity window does not have that code, but because it has a Task Bar button you can get around the issue and manually move it into the visible area.  The Preview list has neither a Task Bar button nor the code that keeps it from showing up on a nonexistent screen.  I'd say that qualifies as a bug, and perhaps it's not an issue in versions of DW that are newer than my CS3.
    Solution:  At work, before shutting down for the day, make sure that all the DW-related windows are dragged over to the primary screen, and those positions will be remembered the next time you run DW.  Then when using the laptop by itself, everything will appear in the visible space.

    Under Window >Workspace Layouts
    You can create two different, well, workspace layouts with your palettes and panels where you like them. Then you switch back and forth when you have both monitors or just the laptop. I'm pretty sure it remembers where everything pops up too. You could test that pretty easily though.

Maybe you are looking for