March 21, 1997

repaint() and Consecutive Lines

Question: My applet draws lines. I click at the place where I want my line to start and then I click at the end of it. It draws a line from one point to the other. How do I use repaint() so that when I draw the second line my

How can I get the display value of a list box?

Question: How can I get the display value of a list box? Answer: In Oracle Power Objects, the Value property of the list box isautomatically set to the internal value of the selected entry in thelist box. A list box, or popup list or combo box, also displays avalue, which

Writing a Factorial Method

Question: Can you help me complete the enclosed program? A “Factorial Method”must be written. /////// File: Factorial.java /////// class Factorial { /* put factorial method here */ public static void main(String[] args) { if ( args.length != 1 ) System.err.println(“Usage: Factorial n”); // converts string to int int n =

Scanning for Words in a String

Question: I am currently writing an application to scan a text file for certain text keywords, and then copy the text (in between the kewords) into a new textfile. Could you please provide me with any tips/code/examples in order to do this optimally? Answer: You might want to try reading

Creating Multiple Frames (Windows) that Work Under a Single Frame

Question: I am attempting to implement an applet that needs multipleframes (windows) that all belong or work under a single frame ? sort oflike an MDI application. However, each of the windows will differfrom each other in size, shape, components, etc. An example might beSymantec’s Cafe IDE for Java with

How do I limit the rows retrieved for a Power Objects report?

Question: How do I limit the rows retrieved for a Power Objects report? Answer: The QueryCondition() method is not called when a report is executed,so you can only set a selection condition for a report by setting theDefaultCondition property for the report. The DefaultConditionproperty is used as soon as the

‘Smart’ Painting

Question: It isn’t clear to me how to do ‘smart’ painting. For example, ifI want to paint only a portion of something, what should I do?There are paint/repaint methods that take arguments such as x,y, etc. Who orwhat calls these methods? Are they provided just as convenient placesfor overrides? Am

How can I dynamically add or delete entries from a list box?

Question: How can I dynamically add or delete entries from a list box, popuplist or combo box? Answer: List boxes, popup lists and combo boxes all use the Translationproperty. The Translation property gives all of these list-typeobjects the ability to display one value to the user while using adifferent value

No more posts to show