Related Posts
Java: Have a JTable’s column preferred width adjusted perfectly to the size of the longest string in the model
Here’s a utility method I’ve coded for FrostWire’s partial download dialog. With it I’m able to adjust a JTable’s column by iterating over the table’s column model data and calculating the exact dimensions required to render the longest string found. You can specify a maximum width (to avoid some really long strings from screwing up […]

How to create a list that holds different object types using `void*` in C.
I remember being in school back around 1998 and not knowing enough about C to do this. After coding in other languages, then going back to C++ and understanding at a lower level how references and pointers work, this was pretty easy to figure out. In this exercise I store elements of different types in […]
NSIS: How to check if the default browser is Chrome
Reading the registry key won’t cut it. This does. [code] ; isDefaultBrowserChrome !define isDefaultBrowserChrome "!insertmacro isDefaultBrowserChrome" !macro isDefaultBrowserChrome Result FileOpen $0 "$PLUGINSDIR\browser_detect.htm" "w" FileClose $0 System::Call "Shell32::FindExecutable(t ‘$PLUGINSDIR\browser_detect.htm’, i 0, t .r1)" ${StrLoc} $0 $1 "chrome.exe" ">" ${If} $0 != "" StrCpy ${Result} "1" ${Else} StrCpy ${Result} "0" ${EndIf} !macroend [/code]