devxlogo

Tip Bank

DevX - Software Development Resource

Saving Object to File

Question: Is it possible to save an object (in my case a collection) directly to a file, or must one extract the object’s properties and save each individually? Answer: Visual

DevX - Software Development Resource

Closing an application from another app

Question: How do I use one application to close another application in Windows 95? I need to overwrite a loaded DLL, so I have to close the application that loads

DevX - Software Development Resource

Mandatory exception handling

Question: Why should some of the statements that might throw an exception be in try/catch block (otherwise the compiler reports a syntax error), and some need not be, even though

DevX - Software Development Resource

Java and Dual Monitor Unix Workstations

Question: I have a question regarding use of dual monitorUnix workstations to display Java screens.Specifically, can I display the mainscreen on onemonitor and the popup on another monitor? Answer: Within

DevX - Software Development Resource

Closing an application

Question: When I press the Close button on my app’s main form, the program appears to end. When I look at the Windows task list, however, my app is still

DevX - Software Development Resource

Dynamic memory allocation

Question: How do you dynamically allocate memory for a two-dimensional array? This is what I had, and my g++ compiler didn’t like it: int **m;m= new int [100][100]; Answer: Yep.

DevX - Software Development Resource

Exception to String

Question: Given an exception, how do I convert the stack trace into a string? I want to capture the entire contents, the message and the trace, to a string. Answer:

DevX - Software Development Resource

Text Area and Cursor Control

The java.awt.TextComponent class (from which TextArea is derived) has three methods to retrieve mouse selection information. The getSelectedText() method will return a String containing the selected text, and the getSelectionStart()

DevX - Software Development Resource

HTTP Authorization Using Java

Many programmers like to use Java to automate access to network resources because it is so easy to write networking code with the Java networking classes. Accessing URLs through Java