---------------------------
| |
| |
| LOG-OUT |
| |
| close this application |
| |
---------------------------
"LOG-OUT" and "close this application" might not be the same Font,
Color, or Size. I want both items to be centered.
Can some one please get me started and/or point me in the right
direction?
Thanks,
John Taylor
Try this...
JButton myButton = new JButton("<html>LOG-OUT<br><font color='red'
size='8'>close this application</font></html>");
Swing components, including JButtons, can accept
html as the component's text.
It would not give the same level of control as
setting the font size yourself, but it is quite
handy..
--
Andrew Thompson
http://physci.org/ - The Physical Sciences project
& host of 1.1C - Sci/Tech site
"Andrew Thompson" <anr...@bigNOSPAMpond.net.au> wrote in message
news:0cvfa.3509$Ov1....@news-server.bigpond.net.au...
I had not realised it was that much..
> It loads a huuuuge of library (or libraries) just to do
> the first html tag.
aah. (shrugs) if the app is shy of 3 meg in the 64(?)
available, it's in trouble anyway. But definitely
something to remember.
Thanks for the tip.. :-)
disc golfer wrote:
> It is very handy to use HTML in your components when it becomes necessary.
> Do be aware however that it will add 2-3 MB to the footprint of your
> application though. It loads a huuuuge of library (or libraries) just to do
> the first html tag.
I removed the xpost to cljp, and I was wondering if
we could discuss this a bit more.
Let's say I want to launch a thread that
1) displays a JWindow splash screen
2) starts loading the HTML libraries.
before my main gui appears. I think this is the standard
way of doing things.
My question is, what would the snippet of code for (2)
look like? Would I maybe do this in the splash thread:
myButton = new JButton("<HTML>Help</HTML>");
Though I've never done this, I'm trying to plan it out
in advance.
Thanks,
Matt