Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #13981 > unrolled thread
| Started by | bilsch <king621@comcast.net> |
|---|---|
| First post | 2012-04-28 16:25 -0700 |
| Last post | 2012-04-29 07:39 -0700 |
| Articles | 10 — 9 participants |
Back to article view | Back to comp.lang.java.programmer
need help with javadocs bilsch <king621@comcast.net> - 2012-04-28 16:25 -0700
Re: need help with javadocs Arne Vajhøj <arne@vajhoej.dk> - 2012-04-28 19:48 -0400
Re: need help with javadocs Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-28 16:49 -0700
Re: need help with javadocs Martin Gregorie <martin@address-in-sig.invalid> - 2012-04-29 00:05 +0000
Re: need help with javadocs "John B. Matthews" <nospam@nospam.invalid> - 2012-04-29 00:10 -0400
Re: need help with javadocs Lew <noone@lewscanon.com> - 2012-04-28 21:14 -0700
Re: need help with javadocs Patricia Shanahan <pats@acm.org> - 2012-04-29 00:25 -0700
Re: need help with javadocs Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2012-04-29 12:00 +0300
Re: need help with javadocs Roedy Green <see_website@mindprod.com.invalid> - 2012-04-29 07:47 -0700
Re: need help with javadocs Roedy Green <see_website@mindprod.com.invalid> - 2012-04-29 07:39 -0700
| From | bilsch <king621@comcast.net> |
|---|---|
| Date | 2012-04-28 16:25 -0700 |
| Subject | need help with javadocs |
| Message-ID | <jnhu9t$19n$1@dont-email.me> |
Several times I've visited Oracle site to browse the class library
documentation but I never come away with information that satisfied my
curiosity. Here's an example. If someone leads me through this example
it may get me moving through javadocs successfully.
EXAMPLE:
I have a book with the following a statement:
Font f = new Font("TimesRoman", Font.Bold, 36);
The book says that Font is from the java.awt package. I understand what
the statement does, but I don't know where to find a list of the
parameters that Font can work with, for instance I would assume
("CourierNew", Font.Italic, 12) will work, but where is this information
listed? Even more important, where will the documentation tell me what
kind of information goes in the =new Font(a, b, c) part of the
statement. Instead of a, b and c why not w, x, y and z? Where does the
documentation tell me the kind and number of parameters that go inside
the parentheses in Font f = new Font()?
TIA Bill S.
[toc] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2012-04-28 19:48 -0400 |
| Message-ID | <4f9c81e6$0$285$14726298@news.sunsite.dk> |
| In reply to | #13981 |
On 4/28/2012 7:25 PM, bilsch wrote:
> Several times I've visited Oracle site to browse the class library
> documentation but I never come away with information that satisfied my
> curiosity. Here's an example. If someone leads me through this example
> it may get me moving through javadocs successfully.
>
> EXAMPLE:
> I have a book with the following a statement:
> Font f = new Font("TimesRoman", Font.Bold, 36);
> The book says that Font is from the java.awt package. I understand what
> the statement does, but I don't know where to find a list of the
> parameters that Font can work with, for instance I would assume
> ("CourierNew", Font.Italic, 12) will work, but where is this information
> listed? Even more important, where will the documentation tell me what
> kind of information goes in the =new Font(a, b, c) part of the
> statement. Instead of a, b and c why not w, x, y and z? Where does the
> documentation tell me the kind and number of parameters that go inside
> the parentheses in Font f = new Font()?
????
http://docs.oracle.com/javase/6/docs/api/java/awt/Font.html#Font%28java.lang.String,%20int,%20int%29
has plenty of information.
Arne
[toc] | [prev] | [next] | [standalone]
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Date | 2012-04-28 16:49 -0700 |
| Message-ID | <Xl%mr.74277$YM2.19618@newsfe05.iad> |
| In reply to | #13981 |
On 4/28/12 4:25 PM, bilsch wrote:
> Several times I've visited Oracle site to browse the class library
> documentation but I never come away with information that satisfied my
> curiosity. Here's an example. If someone leads me through this example
> it may get me moving through javadocs successfully.
>
> EXAMPLE:
> I have a book with the following a statement:
> Font f = new Font("TimesRoman", Font.Bold, 36);
> The book says that Font is from the java.awt package. I understand what
> the statement does, but I don't know where to find a list of the
> parameters that Font can work with, for instance I would assume
> ("CourierNew", Font.Italic, 12) will work, but where is this information
> listed? Even more important, where will the documentation tell me what
> kind of information goes in the =new Font(a, b, c) part of the
> statement. Instead of a, b and c why not w, x, y and z? Where does the
> documentation tell me the kind and number of parameters that go inside
> the parentheses in Font f = new Font()?
>
> TIA Bill S.
>
>
If you do a google search for 'java.awt.font 1.6', you'll likely come
across this page:
docs.oracle.com/javase/6/docs/api/java/awt/Font.html
This is the javadoc for Font. It includes details for the Font
constructor (which is what you were looking at).
HTH,
Daniel.
[toc] | [prev] | [next] | [standalone]
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Date | 2012-04-29 00:05 +0000 |
| Message-ID | <jni0l3$k7m$1@localhost.localdomain> |
| In reply to | #13981 |
On Sat, 28 Apr 2012 16:25:48 -0700, bilsch wrote:
> Several times I've visited Oracle site to browse the class library
> documentation but I never come away with information that satisfied my
> curiosity. Here's an example. If someone leads me through this example
> it may get me moving through javadocs successfully.
>
> EXAMPLE:
> I have a book with the following a statement:
> Font f = new Font("TimesRoman", Font.Bold, 36);
> The book says that Font is from the java.awt package. I understand what
> the statement does, but I don't know where to find a list of the
> parameters that Font can work with, for instance I would assume
> ("CourierNew", Font.Italic, 12) will work, but where is this information
> listed? Even more important, where will the documentation tell me what
> kind of information goes in the =new Font(a, b, c) part of the
> statement. Instead of a, b and c why not w, x, y and z? Where does the
> documentation tell me the kind and number of parameters that go inside
> the parentheses in Font f = new Font()?
>
Its available from the Oracle Java downloads page. The 'Documentation'
tab lets you access an online copy and see what the main Java Library
Javadocs look like. You can also download and install a local copy from
the 'Downloads' tab - its at the bottom of the page in the 'Additional
Resources' table. I think its worth having a local copy, but it is big -
last time I made the comparison the documentation download was bigger
than the matching Java SE JDK download.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
[toc] | [prev] | [next] | [standalone]
| From | "John B. Matthews" <nospam@nospam.invalid> |
|---|---|
| Date | 2012-04-29 00:10 -0400 |
| Message-ID | <nospam-846BC7.00103129042012@news.aioe.org> |
| In reply to | #13981 |
In article <jnhu9t$19n$1@dont-email.me>, bilsch <king621@comcast.net>
wrote:
> I understand what the statement does, but I don't know where to find
> a list of the parameters that Font can work with. For instance. I
> would assume ("CourierNew", Font.Italic, 12) will work, but where is
> this information listed?
The documentation for java.awt.Font addresses this issue by
distinguishing between physical and logical fonts. The former have
particular names and availability, while the latter have been mapped to
installed fonts on a given platform.
Rather than "Courier", consider the implementation's monospaced font:
Font f = new Font(Font.MONOSPACED, Font.Italic, 12);
For larger point sizes, consider the available sans serif font:
Font f = new Font(Font.SANS_SERIF, Font.Bold, 36);
Also, be aware of the several variations of deriveFont().
More details may be found in the tutorial:
<http://docs.oracle.com/javase/tutorial/2d/text/fonts.html>
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
[toc] | [prev] | [next] | [standalone]
| From | Lew <noone@lewscanon.com> |
|---|---|
| Date | 2012-04-28 21:14 -0700 |
| Message-ID | <jnif7a$u1s$1@news.albasani.net> |
| In reply to | #14007 |
John B. Matthews wrote:
> bilsch wrote:
>> I understand what the statement does, but I don't know where to find
>> a list of the parameters that Font can work with. For instance. I
>> would assume ("CourierNew", Font.Italic, 12) will work, but where is
>> this information listed?
>
> The documentation for java.awt.Font addresses this issue by
> distinguishing between physical and logical fonts. The former have
> particular names and availability, while the latter have been mapped to
> installed fonts on a given platform.
>
> Rather than "Courier", consider the implementation's monospaced font:
>
> Font f = new Font(Font.MONOSPACED, Font.Italic, 12);
>
> For larger point sizes, consider the available sans serif font:
>
> Font f = new Font(Font.SANS_SERIF, Font.Bold, 36);
>
> Also, be aware of the several variations of deriveFont().
>
> More details may be found in the tutorial:
>
> <http://docs.oracle.com/javase/tutorial/2d/text/fonts.html>
Picking up on this, and repeating some of what those references try to teach,
the actual fonts on any given system vary. Just like you might or might not
find a particular file on any given hard drive, you might or might not find a
particular font there.
The physical fonts to which John alludes are the uncertain ones, though many
such as "Courier" are so widespread as to be fairly reliable. The logical
fonts are the ones Java guarantees to be present, but you might find them dull
and boring.
If you want to play with physical fonts you'll need some means of what's
called "discovery" - a way for the software to read the system or some
configuration to find out what's there.
You should have the Javdocs bookmarked and refer to them often.
As in many times a day.
--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-04-29 00:25 -0700 |
| Message-ID | <cMqdnV4nd9V4cQHSnZ2dnUVZ_tCdnZ2d@earthlink.com> |
| In reply to | #14008 |
On 4/28/2012 9:14 PM, Lew wrote: ... > You should have the Javdocs bookmarked and refer to them often. > > As in many times a day. > Change that to "per hour" the first time you write code using a particular API area. Patricia
[toc] | [prev] | [next] | [standalone]
| From | Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> |
|---|---|
| Date | 2012-04-29 12:00 +0300 |
| Message-ID | <m3r4v6c3q9.fsf@despammed.com> |
| In reply to | #14008 |
Lew <noone@lewscanon.com> writes: > If you want to play with physical fonts you'll need some means of what's > called "discovery" - a way for the software to read the system or some > configuration to find out what's there. ..and when you (the OP) read the javadoc documentation of the constructor Font(String, int, int) you should find there a "See also" link that tells you how to do that. -- Jukka Lahtinen
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2012-04-29 07:47 -0700 |
| Message-ID | <rskqp7118dhvd4r18grgvqm88nssrobjmk@4ax.com> |
| In reply to | #14007 |
On Sun, 29 Apr 2012 00:10:31 -0400, "John B. Matthews" <nospam@nospam.invalid> wrote, quoted or indirectly quoted someone who said : > >The documentation for java.awt.Font addresses this issue by >distinguishing between physical and logical fonts. The former have >particular names and availability, while the latter have been mapped to >installed fonts on a given platform. You can fairly easily roll your own fancier logical fonts. see https://wush.net/websvn/mindprod/filedetails.php?repname=mindprod&path=%2Fcom%2Fmindprod%2Fcommon11%2FFontFactory.java You figure out which platform, you have, what fonts are available, and decide on a set of fonts to use as your basic set. This way they can be a little more interesting than the logical fonts. -- Roedy Green Canadian Mind Products http://mindprod.com Programmers love to create simplified replacements for HTML. They forget that the simplest language is the one you already know. They also forget that their simple little markup language will bit by bit become even more convoluted and complicated than HTML because of the unplanned way it grows. .
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2012-04-29 07:39 -0700 |
| Message-ID | <5miqp79houjdj6sh0un6p67qdbgvlv5sqc@4ax.com> |
| In reply to | #13981 |
On Sat, 28 Apr 2012 16:25:48 -0700, bilsch <king621@comcast.net> wrote, quoted or indirectly quoted someone who said : >The book says that Font is from the java.awt package. 1. Try looking up the puzzling word or class in the Java glossary. If you don't find it, complain to me. See http://mindprod.com/jgloss/jgloss.html in this case "Font". It will tell a newbie all the important things to know about Font, with some sample code. It will also tell you how to acquire and install fonts. Under "learning more" It will also provide you a link both to Oracle's JavaDoc for the Font class and to a local copy, provided you have put the download in J:\Program Files\java\jdk1.7.0_04\docs To get the documentation download see http://mindprod.com/jgloss/jdk.html You can put it on E: for example, and set up a J: alias. See http://mindprod.com/jgloss/jdrive. 2. go to http://docs.oracle.com/javase/7/docs/api/allclasses-noframe.html Find the class you want. You don't need to know the package. Make a bookmark 3. go to http://docs.oracle.com/javase/7/docs/api/overview-summary.html find the package you want. Look for the class inside that. Look for the constructor and methods inside that. Make a bookmark. If you lose these bookmarks, look up either class or package in the Java glossary and look under "Learning More". -- Roedy Green Canadian Mind Products http://mindprod.com Programmers love to create simplified replacements for HTML. They forget that the simplest language is the one you already know. They also forget that their simple little markup language will bit by bit become even more convoluted and complicated than HTML because of the unplanned way it grows. .
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web