Article View: borland.public.jbuilder.java.language
Article #8802How to change the default font and size on dialogs ???
From: Asger Joergensen
Date: Tue, 27 Feb 2001 21:10
Date: Tue, 27 Feb 2001 21:10
39 lines
2087 bytes
2087 bytes
Hi again
I recived a great help here earlier to day and then i thought
it would be easy, but no i can't figure it out, so please help
me again.
As i say in the headline i want to change the size and
font of the default dialogs. And comming from BC++B
I thought that the below code would do the trick or at
least change the font size in the dialog, but nothing
happens.
How is it done ??
Thanks in advance
Asger
int ScreenRess =
Toolkit.getDefaultToolkit().getScreenResolution();
//ScreenRess = 144 on my PC which is corect.
JOptionPane Pane = new JOptionPane();
if(ScreenRess > 100){
Font TheFont = new Font(null);
int FontSize = TheFont.getSize();
if(ScreenRess < 140){
FontSize += 4;
}else{
FontSize += 8;
}
Font NewFont = TheFont.deriveFont(FontSize);
Pane.setFont(NewFont);
}
Pane.showMessageDialog(null, "Testing FontSize",
"Setting font",
JOptionPane.PLAIN_MESSAGE);
Technical Details
Message-ID:
<3A9C17AE.403C957B@get2net.dk>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!news.tele.dk!194.255.56.67!newsfeed101.telia.com!kinglear.mobilixnet.dk!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,dafba69d262afba3,start X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-02-27 13:26:48 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!news.tele.dk!194.255.56.67!newsfeed101.telia.com!kinglear.mobilixnet.dk!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!not-for-mail From: Asger Joergensen <Asger.P@get2net.dk> Newsgroups: borland.public.jbuilder.java.language Subject: How to change the default font and size on dialogs ??? Date: Tue, 27 Feb 2001 22:10:07 +0100 Organization: Another Netscape Collabra Server User Lines: 41 Message-ID: <3A9C17AE.403C957B@get2net.dk> NNTP-Posting-Host: p301-054.ppp.get2net.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: da,en