Click here to Skip to main content
15,301,414 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am trying to add a JButton to an old desktop application I made using Netbeans.
I want this button to show some caption, so I added it in the properties of the object, using the properties window of the jbutton on the Netbeans IDE , property "text".
No matter what I do, resize the button , alter properties or whatever,the caption doesn't appear.
Can anyone explain me what could be a possible reason ?
And can anyone explain me why other jbuttons also with text properties defined in the IDE correcly show their captions?
Thank you
Afzaal Ahmad Zeeshan 7-Mar-15 9:48am
Is the button not appearing at all, or just the text that you've added to it not appearing on the button?
tiwal 7-Mar-15 14:48pm
The button appears correctly and seems to have the right specified size, but no text appears in the caption ... I don't think it's related to the button's size as even a text of one single character isn't showed .....

1 solution

Found solution on another forum. It seems to be a NetBeans bug , as I was almost sure. When you set the text property in design mode, then you better clean your project : maybe the compilation doesn't work properly otherwise.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900