Caching can be annoying especially when you are doing development work for a project. But in Google Chrome, there is a way for you to disable caching while the developer tools window is open.

Simple go to :

  • More tools
  • Choose Developer Tools
  • Click the wheel setting icon on the far right
  • Click the option Disable cache (while DevTools is open)

That’s it!

Disabling the collapse event of the JTree is possible by adding a listener to it. There may be times where you want your JTree to be always in expanded mode hence disabling its collapse event is the only way to go.

Add a TreeWillExpandListener to the JTree, make the treeWillCollapse() method throw ExpandVetoException and that should do it.

So I had a JTextPane that displays text in HTML format. The color issue arises when I disable the JTextPane. A workaround to this is to use the setEditable() method instead of setEnabled().

Then again, another issue arises. You will be able to select the text even though you cannot insert or remove characters in the JTextPane. If you do not want the JTextPane to have a selection feature if it is not editable, then only way to make it work is to override its protected method processMouseEvent().

This should do the trick.

Related Posts Plugin for WordPress, Blogger...