Hi all, i am working on swing components, i need help for the follwoing topics. 1) how can i change the font of window title bar. 2) how can i change the size of buttons of Joptionpane. 3) how can i change the size of square button of Jcheckbox. your help in this matter will be highly helpful to me. thanx in anticipation jignesh
------------------ Jignesh Patel, Software Engineer, Infosys Technologies Ltd. Bangalore, India.
Hi Jignesh, I am posting here because i have a very similar question to your question number 1. I know that to set text in the title bar you can do:
in the constructor of your JFrame. What i need to know is how to change this text afterwards. Say, to add a filename that's been opened in the app. If i create a String variable say, 'filename' & update it on opening a file, like so:
and then do super("title bar text" + filename ) in the constructor, will a change to filename update to the title bar???
Thanks everyone! Celine
We've heard that a million monkeys at a million keyboards would eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true.<br />- Robert Wilensky
2) java internal properties as i understand it, there is also some level of control available by overriding java default laf properties ... though i haven't tried it... it's probably the sort of thing you would only want to do as a last resort since you can't really guess how user might override/install laf's themselves OR how laf resources might chg in fut versions...
3) custom components
you can write button subclasses using your own icons for buttons and or checkboxes (some basic checkbox behaviors are button-derived).
the custom window title would be a little trickier, because you might need to do something like simulate a titlebar at the top of an undecorated window
Joined: Apr 30, 2004
oops. should say:
for checkbox you would probably want a JToggleButton subclass - and then set your own icons for un/selected