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

HTML and disabled text  RSS feed

 
Don Blodgett
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to be able to have a multi-line JButton that is at times disabled. The problem is that when HTML is used to make the button multi-lined and it is disabled it still looks as though it is not. This of course can be very confusing for anyone using the app. Basically what I am getting at, is there another way that this can be done to get around the problem I am having?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use the font tag, something like this

 
Don Blodgett
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael you gave me a very good idea, although not really what you had stated, but the idea came straight away after I read your post. What I did was create a new class that extends JButton and simplly overrides the setEnabled method. Here is the class for those that are interested.


Although it still lacks the engraved look of Windows disabled buttons I don't think people will really notice or even care.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don,
thanks for posting back the (definitely) better solution.

I'll now refer any other poster's questions (of a similar nature)
to this thread for the solution.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!