Java

Build Faster with This Turnkey SWT Project Template

he Eclipse Standard Widget Toolkit (SWT) is growing in popularity, as evidenced by its use in applications like Azureus and RSSOwl. In this 10-minute solution, you will learn how to make use of an SWT project template that can greatly reduce the time required to build small and medium-sized applications.

Encrypt Sensitive Configuration Data with Java

hen application developers are developing, parameters are often hard-coded in the source code. These hard-coded parameters are often pulled out of the source code and put into property files or configuration files. System and network security policies may force a developer to address security concerns over the data that is

Conditional Compilation

In many cross-platform applications, you have code sections that — depending on the target OS and compiler — need to be either concealed or compiled. For example, code that uses Win32 APIs must be concealed from a Unix compiler. However, when code is compiled under Windows, it should be visible

Take Control of the Threads Created By a Program

Whenever a thread is created in a program, it is unknown when it will execute. This means there may be cases where the parent program has finished but the thread is still executing. One way to ensure that the main program exits only after the thread is finished with its

How to Remove Flashing in an Applet

Most of the Java books talk about double buffering for removing theflashing. It solves the problem to some extent but not 100% perfect in caseof flashing. I am giving the following tricks to solve the flashing problemin animation : 1) Use Media Tracker for downloading the images.2) Use double buffering.3)

Interplatform Networking

Question: I want to connect a Java client program to a C/C++ server applicationusing sockets. What is the easiest way of doing this? Answer: Java provides the ability to write platform independent programs thatwill run on any machine. TCP/IP provides the ability for programs tocommunicate with each other over a

Determining the Top Level Frame

Question: I have developed a custom AWT component that can be placed at any level in a component hierarchy. How can it determine the top level Frame in the hierarchy? Answer: When using components derived from JComponent, it is possible to usegetTopLevelAncestor() to determine the topmost enclosing container inthe component

Java Applications and the “Current Directory”

A recurring question in the Sun Java Forum groups is, “How do Ichange the current directory of my Java application?” The correct answer is that you don’t! Java applications don’t use the metaphor of ‘current directory’ in the same way native Unix and Windows applications do. A native Unix or

Modifying Enumeration Data Sources

Since the java.util.Enumeration class provides read-only access to the element list it represents, it may intuitively seem that the list of elements is immutable, or cannot be changed. However, the Enumeration is often used as a way to reference data stored in some structure that can change, even while the

No more posts to show