Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

extending classes and variables

$
0
0
Good morning i have to ask something . I have a class extending JFrame . withing the class lets say Main ,i have a button which has a mouselistener and does some things . Now i have to make a separate class for this button which extends JButton but i have to use in it many variables and methods that my main class has . How i do that?? i tried to make a constructor in the class button but i have to insert many arguments , i tried to extend button but it can extend only JButton.

Viewing all articles
Browse latest Browse all 51036

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>