> so how do you do BOLD AND ITALIC? obviously this gives me an error..
>
> label.setFont(new Font("Arial", Font.BOLD, Font.ITALIC, 22));
> label.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 22));
| is doing a bitwise or.
Font objects are actually quite expensive to create and dispose of. How
much is highly platform dependent. So if you're doing this often, us the
same Font object.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Oliver Wong - 08 Sep 2005 17:10 GMT
>> so how do you do BOLD AND ITALIC? obviously this gives me an error..
>>
[quoted text clipped - 3 lines]
>
> | is doing a bitwise or.
To get a better understanding of this, study some binary arithmatic and
boolean operators. ORing flags together is a fairly common practice in Java,
and very common in C and C++.
- Oliver
Roedy Green - 10 Sep 2005 12:12 GMT
> To get a better understanding of this, study some binary arithmatic and
>boolean operators. ORing flags together is a fairly common practice in Java,
>and very common in C and C++.
see http://mindprod.com/jgloss/masking.html
http://mindprod.com/jgloss/binary.html
http://mindprod.com/jgloss/hex.html
http://mindprod.com/jgloss/precedence.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
>so how do you do BOLD AND ITALIC? obviously this gives me an error..
sum or OR them together
They are essentially constants is a bit map.
See http://mindprod.com/jgloss/font.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.