Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Hello am kinda new with inheritance and extending 1).There are 2 classes. One class makes a JButton 2)The second class is suppose to extend this class 3) So when the main motho calls the second class it returns a button with the label "hello" , a false painted border and a gif picture attached to it. I know you must be saying shy didn't I just combine everything into one class..I can do that.. but I have to get familiar with inheritance so that I can do a bigger project later on. here is the code..can someone correct it for me please.. thanks in advance import java.awt.*;
Button2 item = new Button2(); /*------------------------------*/ } /*--------------------------------*/ class Button2 extends Button1 Replies:
|
Sponsored Links
|