Category Archives: Windows/.NET

I also program in .NET.

Right Click on JComboBox [Java Swing component]

Recently I was writing a small UI tool in Java Swing at work and found a strange bug in Java Swing, which was first reported in 1998 but is not fixed yet. I thought of documenting the workaround here so that it is useful for others who are faced with the same problem.

I wanted to trigger a popup menu when a right click event happens on a JComboBox (drop-down) component. I tried adding a MouseListener to the JComboBox, but it was not getting triggered. After spending a couple of hours, I finally came to know that it was because of a bug in Java Swing. The worst part is that the bug was closed as “Will not fix”

Fortunately, there is a workaround for this. Instead of adding the MouseListener to the JComboBox, you have to add it to all its children, like how it is done in the following code snippet.

After implementing this fix, I was able to trigger the popup when the combo box was right-clicked. Hope this helps someone who is affected by this bug.

Posted in Windows/.NET | Tagged , | 4 Comments

Make Acrobat Reader load faster

I am a great fan of PDF documents and I am using Acrobat Reader right from version 4.0. But in the earlier versions I had only one complain. It used to take a long time for it to load. So I used to keep the main reader window open even if I am not reading a document so that then next time when I need to open a file I need not wait for it to load again.

But that has changed a lot in the latest version 7.0 of Acrobat Reader. Seriously Adobe has done some tweaks to make it load faster. But recently I found that it is loading lot of Plugin by default and a considerable amount of time can be reduced during loading if the optional Plugins are removed.

I was going through the installation directory of Acrobat Reader and found that there is an optional directory where we can put those Plugins which we do not want to load by default. This directory can be found in the following path (C:\Program Files\Adobe\Acrobat 7.0\Reader\Optional) and the Plugin directory can be found in this path (C:\Program Files\Adobe\Acrobat 7.0\Reader\plug_ins). I am assuming that you choose the default directory during installation. If you have installed it in a different directory then change the path accordingly.

The optional Plugins can be moved from the Plugin directory to the optional directory. Each Plugin can be identified but the extension (.api). But before doing that find out the Plugins which you are not going to use. You can see the list of Plugins and their dependencies in the Plugin’s page.

Click Help -> About Adobe Plugins.

areader1.GIF

You will see the following page.

areader2.GIF

From this page you can get a fair idea of Plugins that you don’t need and then move those corresponding .api files to the optional directory. While doing that please note that some Plugins may depend on other Plugins for loading. So if you get an error message stating that a particular Plugin was not able to load properly then restore the necessary Plugins. You will notice a significant improvement in the time taken for loading after moving the optional Plugins.

Here the list of Plugins which I have moved for your reference.

  • Accessibility.api – Acrobat Accessibility
  • Annots.api – Comments
  • AcroForm.api – Forms
  • MakeAccessible.api – MakeAccessible
  • Spelling.api – Spelling
  • soap.api – soap
  • Sendmail.api – Send Mail
  • reflow.api – Reflow
  • LegalPDF.api – Legal PDF
  • DigSig.api – Digital Signature
  • Multimedia.api – Multimedia
  • PPKLite.api – PPKLite
  • Updater.api – Updater
  • eBook.api – Adobe DRM
  • PDDom.api – PDCom
  • SaveAsRTF.api – Save as RTF
  • Checkers.api – Checkers

Posted in Windows/.NET | Tagged , , , | 2 Comments

Major Security Threat in IE

Recently I came to know about a major security threat in Internet Explorer from Lifehacker tips. Any website can read the text present in your clipboard with out your knowledge and can even replace the text present in your clipboard. I went to the article present in the tip and they mentioned that you can use ASP, PHP or Perl together with Javascript to retrieve the text.

This interested me much and I tried to figure out how to do it and to my surprise I was able to retrieve the clipboard text with just two lines of javascript code alone without even using any server side script like ASP or PHP. I have written more about it and you can find it out in this url (www.clipboard.googlemyway.com).

After retrieving the text I was thinking what a website can do by knowing your clipboard text and then an idea struck me what if it is combined with AJAX. The website can get the contents of the user

Posted in Windows/.NET | Tagged , , , | 1 Comment