• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

disappearing text on disabled buttons

 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Until now I've not had an issue with JButtons on an interface retaining their text label, but since I've recently added a plugin app to my main applicaton it has had a strange effect on those buttons that are initially disabled on the main application. I've been trying to figure out what is different about this plugin application that is affecting the main application in this manner, but it eludes me. I'm hoping someone can just suggest setting some property on the buttons in question to ensure they always display their text label whether they're enabled or not.

Allow me to explain that the main application has a Language menu with three submenus (JMenuRadioButtons) that allow the user to select to a different language. They each call a method named changeMenus_Buttons(). Like so:



The changeMenus_Buttons() method simply accesses every menu and button and changes its text from a Resource file to the appropriate text in accordance to the language selected. Under normal operation I can switch between each language and all menus and buttons change as expected. But the minute I launch my plugin and then close it, then change the language, all those buttons that were disabled lose their text label. If I enable those buttons, then their text labels appear. So I know that the method call to changeMenus_Buttons() is doing its job, I just can't figure out what it is that my plugin is doing to change the behavior of the disabled buttons. I have other plugins that I use but none of them affect the buttons in the same way.

If you look at the code above, you'll notice that I'm calling revalidate() and repaint() on the JPanel. In this case, it appears those calls don't affect those buttons that are disabled after having launched the new plugin. This is a baffling situation. I'm hoping someone their has encountered a similar phenomenon and can help out.

Please advise,

Alan
 
Kathleen Angeles
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of plugin is that? Eclipse plugin? java native dll? etc.?
 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a plugin I wrote for my own application.

Alan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic