• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

HTML and disabled text  RSS feed

 
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?
 
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.
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!