JButton getText Example

JButton getText Example

JButton getText method returns the button text.Generally, there are three JButton constructors.One example takes a string, other takes Icon or both.We can set JButton text using setText method

JButton getText code example

 

 Output:JButton getText Example

Related Tutorials

JButton setToolTipText Example

JButton setIcon Example

JButton setText Example