Creating Radio Buttons Using the AWT
The way you create a set of radio buttons is significantly different between Swing and the AWT. With Swing, you instantiate the buttons and add them to a group object
The way you create a set of radio buttons is significantly different between Swing and the AWT. With Swing, you instantiate the buttons and add them to a group object
Radio buttons behave in the same mutually exclusive way in Swing and the AWT. However, the way that you create a set of radio buttons differs significantly between Swing and
Using Swing, you can easily create hidden buttons similar to the Back button used in Netscape Communicator 4. Hidden buttons look like normal graphic elements on the screen until you
Infrastructure functions that are used extensively should adopt the “trust the programmer” policy by not performing additional error checking. This policy is widely used in C/C++ standard libraries. For example,
An empty class doesn’t have any data members or member functions. You’d think that the size of an object of such a class would be zero. However, the Standard states
Andrew Koenig devised an algorithm for resolving namespace members’ lookup. This algorithm is used in all standard-conforming compilers to handle cases like the following: namespace MINE { class C {};
A string literal is a sequence of one or more characters enclosed in double quotes: cout
Operators new and delete can be declared in a class scope. However, the Standard prohibits declarations of these operators in a namespace. Why is this? Consider the following example: char
This small subroutine iterates through and closes all databases in the Databases collection of the Workspaces object. For each database in the collection, it iterates through each Recordset and closes
To return to a previous location in your code, press Ctrl+Shift+F2. This way you don’t need to set bookmarks. VB only keeps track of the last eight lines of code
The ID (counter field) of a newly inserted record is available immediately after the AddNew method executes. Retrieving the ID at this point means you don’t have to mess with
To quickly go to the code for a called function, subroutine, or property, simply place your cursor on the called routine and hit Shift+F2. VB will immediately go to the
In the tip, “Please Stop Printing!” [“101 Tech Tips for VB Developers,” Supplement to the August 1997 issue of VBPJ, page 13], the code works fine with one exception. If
If old words or marks have dried on a white board and you can’t wipe them off, write on top of them with a fresh pen and then rub them
Use this code to create a comma-separated value (CSV) file from a recordset based on a SQL query. A number of applications, including Excel and Access, can read CSV files:
Question: If I make a C++ library and supply it to a clientwho does not have a C++ compiler, can theycall my C++ functions from their C routines?That is, is
Question: Why is int 2 bytes with real mode compilers, but 4 bytes with protected mode compilers? And why is the class defination ended with ;-mark, since other definations aren’t?
Question: When writing a Windows 95 program using VC++, how do you play a MIDI sound file? Answer: Musical Instrument Digital Interface (MIDI) is a standard used by electronic keyboards
Question: Can you supply me with boilerplate code for a simple console tsr program? I’m using VC++ 4.0, and I want to create a console program to check a directory
Question: Is it valid to attempt to allocate (via ‘new()’) dynamic memory prior to ‘main()’? I am working on software that has static *’s to class objects, and through some
Question: Coming from a Basic/Visual Basic background, how hard is it for one to transition to Visual C++? Can I transition without, first, learning C itself? What books would you
Question: I want to make a log file circular using C++ I/O manipulation. I am new to C++ and come from a C background. To me stream I/O is completely
Question: Can you tell me how to write a program that right-shifts an integer variable 4 bits? The program should print the integer in bits before and after the shift
Question: What are the main differences between C++ and HTML? If I can use HTML, how hard will it be for me to use C++? Answer: For the most part,
Question: I need to figure out a way to insert a chunk of HTML after the begin tag of the body element without causing the HTML that is in view
Question: In a VBScript function I assign the window.event.ToElement to an object for some functionality. The problem is that if the mouse is moved outside of the browser window, the
Question: I have two TField400s. The first TField400 contains the value “12345678” and other TField400 contains the value “11111111”. I want to move the “5678” from the first TField400 and
Question: I have used InsertAdjacentHTML to insert a dynamic number of images onto a page in Internet Explorer 4. Having given the new images a single ID, I can refer
Question: I am having trouble creating a site where customers can click something in a parent window and have a picture appear in another child window. I then want customers
Question: I have built several pages that use VBScript to pull information from a Microsoft Access database. My problem is that if a user tries to use a single quote