The Latest

DevX

Standard Exceptions

C++ defines a hierarchy of standard exceptions that are thrown at run time when abnormal conditions arise, such as when operator new fails. The standard exception classes are derived from

DevX

Two Distinct #include Directives

The preprocessor #include directive appears in two flavors: #include < vector > // angular brackets and #include “myclass.h” // quotes The two are not interchangeable. The angular-bracket version applies to

DevX

Create a Globally Unique Identifier (GUID)

I use this routine in almost every application I develop. It’s handy whether you need a key for a collection or whether you use it in a database: Option ExplicitPrivate

DevX

Suspend Code While Waiting for Shelled Process

This “wait” routine suspends your code and waits for the shelled process to finish. It comes in handy when you need to run another scriptatch file during your process. Use

DevX

Use UNC Names to Refer to Network Drives

If you write programs that access information on a network server, you never want to hard-code drive letters. Not all software vendors take advantage of the Uniform Naming Convention (UNC)

DevX

More Tips for “Creating a Better Mouse Trap”

I would like to add a few things to the “Building a Better Mouse Trap” tip [VBPJ November 1996, page 56]. This approach also works for any message, including button-up

DevX

Send Messages to WinPopUp from Your Application

If you have an application that must run “unattended” and you want it to alert you if something goes wrong, your application can send you a message through WinPopUp. WinPopUp

DevX

PB6 interface to VB5

Question: How can I use VB5 components from within PB6? Can VB5 deliver a DLL that we can communicate with, or are there better methods? Answer: The best method of

DevX

Rich text set default font

Question: How do I control the font size in a rich text edit? I am pulling text from a variable and applying it to a rich text edit by: rte_1.SelectTextAll()rte_1.ReplaceText

DevX

Passing arguments to an Exe

Question: I have an .exe of PB app “sales.” While I type c:sales.exe, I will also pass a parameter such as c:sales.exe auto. Now I want to access this parameter

DevX

Wrapping Text in TextArea

Question: Is there a way to wrap text that is written to the TextArea? Answer: The java.awt.TextArea class does not have built-in support for wrapping text, but you can implement

DevX

Saving Panels with TextField?

Question: I am writing a presentation application and want to take a Panel and add TextFields and maybe Images to it. Is it possible to save this Panel with TextFields

DevX

TextField listeners

Question: I want to capture an event that signals a user’s completed update to a TextField. Answer: In general, a user will finish entering text in a TextField by pressing

DevX

Copy & Paste

Question: How can I copy the selected text from a TextArea to the system clipboard or paste from the system clipboard to a TextArea? Answer: Java 1.1 introduced the java.awt.datatransfer

DevX

Textediting functions in Java

Question: I’m trying to make a text editor in Java, andI want the editor to be able to make words and even pieces of words italic, bold, or underlined. It

DevX

HTML browser in Java

Question: I am tring to make a stand-alone application that can read HTML files and render them like a Web browser. How can I do this in pure Java? Answer:

DevX

Port information

Question: I need to take a port number as input froma user. How can I check if the port numberentered by the user is free and not beingused by any

DevX

Setting textfield focus

Question: I have an initially disabled TextField on a frame.When the user clicks a specific button the TextField is enabled. How do I set the input focus to the TextField

DevX

Classes in sun.* packages

All the classes in sun.* that accompany the Sun JDK are provided assupport classes that are used to implement specific sets of functionalityfor the core JDK classes. The classes in

DevX

Converting a String into an int

The Java core API possesses a method equivalent to the C atoi() function in Java. The java.lang.Integer class contains a method called parseInt()which will convert a String into an int.

DevX

Generating Random Numbers

The java.util package contains a class called Random which you can useto generate random numbers. A Random object represents a repeatingpseudo-random sequence of numbers. You can either fetch the next

DevX

Array Reflection

The java.lang.reflect package provides an Array class through whichthe values of an array can be accessed. It is usually more effectiveto cast the array after it has been obtained through

DevX

Java Arrays

C programmers are used to dealing with multidimensional arrays as chunksof contiguous memory which can be accessed through pointer arithmetic.In Java, an array is an actual object, and a multidimensional

DevX

Components Help Team Based Development

Aside from fitting well with the Microsoft environment, creating components and component based software also works well with the management and tracking of development teams. Components naturally divide into manageable

DevX

Performance Monitor Defaults

On NT, do you ever wonder why Performance Monitor starts up blank on some computers, and others have process monitored automatically upon start up? Well, Performance Monitor first looks for

DevX

Naming Standards Beyond Programming

Naming standards apply to areas besides only those of developers and source code. All areas of a software solution benefit under a consistent naming process. SQL Server table names and

DevX

Avoid Monolithic Tables in SQL Server

You can improve SQL server performance if you avoid creating tables in a monolithic fashion. By monolithic I mean tables that have dozens and dozens of fields that are not