March 31, 1998

Are there any yield/sleep type statements in PB?

Question: I need to find a way to yield the CPU (for x amount of time) from one event to process another event (for x amount of time) in the same application. An event in my application seem to be hogging the CPU from another event. Thanks,?Thai Answer: The command

Printing Components

Question: How do I print out a component? Answer: Java 1.1 introduced the java.awt.PrintJob and java.awt.PrintGraphicsclasses. It also added the print(Graphics) and printAll(Graphics)methods to java.awt.Component, and the printComponents(Graphics) methodto java.awt.Container. To print a component, you really ony need toconcern yourself with the PrintJob class and the print(Graphics)method in Component. The

Java and NT Services

Question: How can I run a Java server application as an NT service? Answer: You can run a Java server appliation as an NT service if you use theMicrosoft SDK for Java. You can download the latest version fromMicrosoft’s web site. The SDK includes a package called com.ms.servicewhich contains a

Parsing a string into a date

Question: I’m writing a class that reads a log file containing timestamps.My StringTokenizer returns the timestamp as a String and I then haveto store it in a date container. Should I use Date or GregorianCalendar?Also, how do I use DateFormat to parse the timestamp? Answer: The first question is difficult

Completely hidden application

Question: Here is one that I couldn’t figure out for months!Will I be surprised if anyone can come up with a solution to this. How do you create a program that is completely hidden from the user. That is, it does notappear in the taskbar and not in the TASKLIST

Java Product Version Confusion

Question: I’m reading a book on Java 1.1 that refers to various classesthat do not exist in Microsoft Visual J++ Professional Edition,Version 1.1, which apparently installs V1.02 libraries. How canI update the Microsoft Java API packages to Version 1.1, which iswhat I thought I bought? Answer: I’m addressing this question

Always on top window

Question: Is it possible to create an ‘always on top window’ in java? Answer: The short and perhaps not so sweet answer is “No.” At least not in 100%Java. You can always write native code to implement this using native windowing system calls. However, if all you want is to

Taskbar Icon for Dialog

Question: How can I set the icon image for a java.awt.Dialog like you can fora java.awt.Frame using setIconImage? Answer: Unfortunately you cannot do this. A Dialog inherits the icon of its parentFrame, although this may not hold true for all Java environments.

Java File date

Question: Is there anyway with java to get a file’s date? Answer: Unfortunately, there seems to be no platform-independent way of doing this.The lastModified() method in java.io.File returns a system dependent valuethat can only be used to compare the dates of files. However, the Unixand Windows95 versions of the Sun

No more posts to show