devxlogo

Tip Bank

Determine the Version of .NET on a Client PC Using JavaScript

Use the following JavaScript to determine which .NET version is on a client PC: &ltscript language=”JavaScript” type=”text/javascript”&gtvar a = navigator.userAgent.match(/.NET CLR [0-9.]+/g);if (a == null) document.write( “.NET Framework(s) is not

Minimize Flickers in Windows Forms

Users often experience flickers when loading forms or during other operations. To minimize this flickering, enable double buffering on the form, as illustrated below: // Activates double buffering this.SetStyle(ControlStyles.DoubleBuffer |

Make an Immutable Class

The following code shows how to make an immutable class: package com.test;final class TestImmutable{// instance var are made private to restrict the access // and final to not get reassigned

Read a Tab Delimited Text File

This tip shows how to read from a log file using a specified format. The following code takes all the logs for the date mentioned in the date control. The

Avoiding Unnecessary Object Construction

One way to avoid unnecessary object construction is to use a reference instead of an object to store the unnamed temporary object returned by value. This tip references both Scott

Place a Colored Border on a Control

Suppose you simply want to change the border color of a control to something other than black, so you looked for the BorderColor property in the Properties Window…but it’s not

Disable JSP Auto-Reloading

Most application servers/JSP engines can load JSP servlets dynamically. This allows the application server/JSP engine to load the JSP servlets every time you configure them. For example, suppose you configure