devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

Determine Your Heap Size

The following example program prints out both the total and free memory sizes, allocates a chunk of memory, and then prints the memory sizes again. If the initial size of

Font Metrics

Font properties that affect the rendering of strings are represented by the FontMetrics class. You can determine the FontMetrics of the current font in a graphics context with Graphics.getFontMetrics(). If

Beware of Static Finals

Consider this scenario, you define a public static final variable in one java file, and access the variable in other java file. Now, if you change the value of static

Remote File Size

Question: How can I discover the size of a remote file stored on an HTTP server? Answer: The HTTP protocol supports the transfer of extra information about thecontent referenced by

Determining Heap Size

Question: How do I find the size of the heap memory that is available for Java program? Answer: The maximum size of the Java heap is fixed by the JVM

Form Input and JSP

Question: I want to collect form data in a JSP page where the form issubmitted by one of many possible links (possibly passing values usingURL rewriting). In one case, I

Destroying Objects

Question: In VB, you can release the object’s memory with the following: set object = nothing How do you accomplish the same thing in Java? Answer: The analogous way of

String Search Mechanism

Question: How do I do a string comparison where I want to determine if onestring is contained within another? For example: Str1 = “Degree in IT”;Str2 = “Diploma or Degree

ServerSocket Port Binding Error

Question: My Java server compiles perfectly, but when I try to run it on mymachine I get an error when it tries to open up the ServerSocket onport 2525. I

JVM Process ID

Question: On a POSIX-compliant system, is there a way to get the process ID ofthe JVM running the current code? Answer: There is no standard means of obtaining the process

Date Arithmetic in Java

Question: I have a ResultSet created using JDBC and it contains some datefields. Now I want to subtract one date from the other. Howdo I do this? Answer: Date arithmetic

Reloading Java Classes in JSP Development

Question: How can I force a reload of a JavaBean that is being used in a JSPpage? The problem is I am developing a JSP-based Web application andI need to

Entering Information Into Two Tables at Once

Question: I have two tables: Items_table: Item_id (primary key) Description (foreign key) Item_priceDescrip_table: Description (primary key) Item_type How do I enter information into the two Description columns simultaneously? Answer: An

Changing a Column Name Within a Table

Question: Is it possible to change the name of a column within a table after it has been created? For example, I want to change the column “Name” to “FName”.

EXE Starts and Ends Immediately

Question: When I build my application as an EXE and run it, the application comes up and then immediately disappears. What is wrong? Answer: You need to create an event

Filling a Field with Data

Question: How can I fill a numeric field with a sequence of numbers using SQL? For example, I want a field named NUMBER to contain the numbers 1 for the

Restricting Users’ External E-mail Access

Question: We have a private WAN network with Exchange Server 5.5 and also have one inbound/outbound Internet mail service for all people to use to send Internet e-mail. I want

Not Wanting Table to Remain Read-Only

Question: I created a command button on the main form. It runs another wizard-generated form that edits a table in the database container. It works in test, but when I

Create a Context Menu

Question: I’m having a problem creating a context menu in a grid (by clicking on the right button of the mouse). I created this menu by programming a method that

OLE Automation of Word

Question: How do you open a specific Word document through a Visual FoxPro program? Answer: You simply add the document to the Word.Application’s Documents collection. Here is a code sample

Determine the number of mouse buttons

Sometimes is useful to know how many buttons the user’s mouse has. This value can be obtained by calling GetSystemMetrics. The constant to pass as parameter is SM_ CMOUSEBUTTONS. Here’s

Open a Control Panel dialog or wizard

Have you ever needed to open a Windows dialog such as Internet Properties, New Hardware, Modem Properties or any other dialog you can find in the Control Panel? Well, it’s

How did Windows start?

If you need to know how Windows was started you have just to call an API function: GetSystemMetrics. Passing the SM_CLEANBOOT constant as parameter, the function returns a Long value

Create a simple Windows inspector

It takes only a handful of lines of code to create Windows inspector program, that is, an utility that lets you display the handle, the class name and the contents

Open the Internet Connection dialog

The dialog you see when you start an Internet connection is implemented in the RNAUI.DLL file, and the specific function is called RnaDial. To open this dialog from your application

Hide the application in the Task List dialog

As you know, when you press CTRL+ALT+CANC the Task List window appears. This dialog allows you to see all the running processes and also to terminate them. If you don’t

Manipulate Dates With VBScript’s DateAdd Function

Browsers Targeted: Internet Explorer 4+ Dates can be a pain to deal with when working with scripting. Fortunately VBScript 5.0 supports a number of different functions that can simplify the

Add a Counter to Your Web Page With XHTML

Browsers Targeted: Internet Explorer 3+, Netscape Navigator 3+ You can take advantage of the new XHTML standard in your own code, regardless of your browser, to enhance the capabilities of

Forcing Data Entry in Uppercase

Question: I would like to force data entered into a form to be uppercase. This is probably basic, but I can’t figure it out! Answer: What you are looking for