Results 1 to 6 of 6
Thread: Font type not getting applied
- 02-26-2010, 06:21 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 19
- Rep Power
- 0
Font type not getting applied
hi friends
am buiding java awt proj n to change the button font type i use following code
but after execution only the size n Plain is getting applied but whr as the font type is not getting applied..Java Code:Button bt= new Button("Exit"); bt.setBounds(250,250,50,30); bt.setBackground(Color.gray); bt.setForeground(Color.white); bt.setFont(new Font("Old English Text MT",Font.PLAIN,20);
kindly help me..
plzzzzzzzzzzz
- 03-02-2010, 08:05 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
- 03-03-2010, 08:52 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 19
- Rep Power
- 0
hi josh..
thank for this..
but even after trying this am not getting the font type..
even if i put any font is not accepting it..
- 03-03-2010, 09:08 AM #4
Member
- Join Date
- Feb 2010
- Posts
- 19
- Rep Power
- 0
ya josh am using jdk1.6 to execute my programs does that matter in any ways
thanks n regards
Arsh
- 03-03-2010, 10:35 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
- 03-03-2010, 01:55 PM #6
Member
- Join Date
- Mar 2010
- Posts
- 8
- Rep Power
- 0
Hi afreaz
Actually in java u can categorize fonts to 2 type
1 Physical Font( Normal Fonts available in your machine)
2 Logical Fonts (Java Fonts which is not a font actually but maps some of the your physical font)
Now there only 5 logical fonts as of now, and they are
Dialog, DialogInput, SansSerif,Serif and Monospaced (All are available in Font class).
Now AWT supports only these 5 logical fonts.
So better option is to move to swing so that u can use all fonts are available.
Similar Threads
-
operator || cant be applied to OlimpicFrog, boolean
By darkblue24 in forum New To JavaReplies: 2Last Post: 02-16-2010, 12:37 AM -
WordSearchAPI cannot be applied to (java.lang.String)
By LordBios in forum New To JavaReplies: 4Last Post: 01-29-2010, 09:57 PM -
How to change font/ font color etc in a graphic object using JCombobox?
By JavaInLove in forum AWT / SwingReplies: 5Last Post: 04-25-2009, 08:00 PM -
Error: cannot be applied to (java.lang.String)
By carl in forum New To JavaReplies: 1Last Post: 08-05-2007, 06:33 AM -
Error: javax.swing.AbstractButton cannot be applied to...
By barney in forum AWT / SwingReplies: 1Last Post: 08-01-2007, 06:10 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks