devxlogo

Tip Bank

NT Registry Query

Question: What is the best browser-based way to read values from the Registry? Can JavaScript do it? Answer: There is no easy way to read the Registry on a user’s

Check if file exists

Question: Is there a way for me to check if a file exists before writing to the file using Java? Answer: You can determine if a file exists by calling

Image loading

Question: I’m having trouble reshaping a frame to the size of a loaded image. I start out by saying: int fx = image.getWidth(this); int fy = image.getHeight(this);then I try to

Exponents

Question: How do I go about using exponents in Java? For example, how would I do 6 to the power of 3? Answer: You want to look at the documentation

Calculating # of days between two dates

Question: I need help to calculate the number of days between two dates. This may seem like a trivial question, but for the life of me, I cannot find away

Dynamic class casting

Question: Does java have dynamic_cast? If so, how is itused? Answer: All class casts of nonprimitive types in Java are dynamic and performed at runtime.In C++ the dynamic_cast operator will

PB 16-bit or 32-bit under PB4

Question: I have PB 4.0 installed under Windows NT. How do I tell if it is 16-bit or 32-bit PB? Answer: You can check the environment object for an ostype