String, text, numbers, I/O II part
character and call charWidth(char ch) on each. It should return the same value for
each character if it s monospaced, different values for each one otherwise.
This might be a little "hacky", but if you really need an idea...
Karsten
 Q: I want to create a Date object by just specifying the Year, Month and Day.
e.g. the user can enter 1998 as Year, 11 as Month of Nov, 15 as the day.
With these three information, how can i create a Date object (or similar object that
stores the data)?
Answer: The correct way to do this is something like this:
Calendar cal = Calendar.getInstance();
cal.set(1998, Calendar.NOVEMBER, 15);
Date date = cal.getTime();
 Q: Let s say I have a text string with the text: Hello! Then how do I add quotes to
it so it will be: "Hello!"
Answer: 
answer is String s = "Hello!"
"\"" + s + "\""
and if the result is to become the new value of s,
s = "\"" + s + "\""
 Q: I want to send Image through network. I made OutputStream to send Image...
OutputStream out = socket.getOutputStream();
but I can t send Image directly.
How can I send Image?
Answer: Unfortunately, the java.awt.Image class is abstract and is not serializable,
otherwise this would be easy.
From the Java docs: "The abstract class Image is the superclass of all classes that
represent graphical images. The image must be obtained in a platform specific
manner."
Consider using the Image.getSource method, getting the producer, getting the bytes,
then send [width][height][bytes...].
  
Mark Watson, Java consulting, Open Source and Content: www.markwatson.com
Commercial software products: www.knowledgebooks.com
 Q: I want to get the code behind an HTML page.
For example: I lock on www.sun.com and then get the source code behind the page
(what you see :right mouse click "source code" for window users) and put it in a file
or something like that....
I am particularly interested in retrieving the code of html
I thought to do it with getContent() or with bufferStreamReader() something like that..
file:///F|/a_jsite/350_tips/stings_text__date_numbers_io II.htm (3 of 7) [2001 07 08 11:25:00]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved