Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

L&F weird behaviour  RSS feed

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want all my swing buttons to look the same, so i subclassed jButton:
they look flat and on mouse entered they bevel.
i think this:
will erase the rectangle around the button.
i also have a menu to toogle L&F between windows and metal.
(i'll post relevant code if needed)
All was ok till:
1) i opened my app (opens first in winXP L&F)
2) changed to metal
3) and to winXP
4) and again to metal once again.
That's when all happens: all buttons have the dreaded rectangle around and in some cases the caption looks like:
Actu... instead of
Actualizar
when the mouse exits the button area all reverts back to how i want them!

What's wrong?

TiA
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
case solved, i hope:

added to Botao class
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this way i lose my bevel efect
i also tried:

but does no good so no solution again
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i finally got it!

now that a look at it, i can refactor last two methods to:

[ May 16, 2007: Message edited by: miguel lisboa ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!