HI ,how can i get the size of a JBUtton JLabel . I always get 0 when i use the getHeight or getWidth method .

You may find that the size isn't set until the button is added to a container (JFrame or whatever) and that container is layed out (eg via pack()). The size definitely should work any time the button is visible on the screen.

weiphos2012 - we try to be helpful and friendly on this forum. Your post was neither.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.