December 8, 1997

java (arrays)

Question: How do you create and use a multidimensional array of type int. Answer: C programmers are used to dealing with multidimensional arrays as chunksof contiguous memory which can be accessed through pointer arithmetic.In Java, an array is an actual object, and a multidimensional arraymust be constructed as a an

Adjusting Java applications to screen resolution

Question: We are developing a Java application which we want to distribute.We want our application main Frame/window to occupy the entire screen. But at runtime how do we adjust the size of our screen tothe resolution at the clients machine. Is there a way in Java to rectifythis problem???ThanksSameer Answer:

Text area & cursor control

Question: Hi, I am looking for a way of displaying a textareabox and then being able to tell what text the userhas highlighted (with mouse) and then replacing thetext? Can this even be done with a applet? Answer: The java.awt.TextComponent class (from which TextArea is derived), hasthree methods to retrieve

HTTP Authorization

Question: I am writing an application that uses the URLConnection class to open a connection to a web site. However one of the sites I wish to access has web server access control enabled. If I am going through a browser I see a dialog box requiring a username and

non-blocking read

Question: How do I control blockingin Java. For example, in telnet Iwould like to take an actionif the user presses a certainkey. This requiresnon-blocking read; I think? Answer: It is not currently possible in Java to set an arbitrary stream tobe non-blocking as you would with a call like fcntl(fd,