Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Graphics gp = new Graphics();
- import java.awt.Graphics;
- public abstract class GUI extends Graphics{
- public void painter(){
- GUI gp = new GUI();
- gp.drawString("Hello People!",2,10);
- }
- }
- class GUI extends JComponent {
- public void paintComponent(Graphics g) {
- super.paintComponent(g);
- g.drawString("Hello People!", 2, 10);
- }
- }
- import java.awt.Graphics;
- public class GUI extends Graphics{
- public void painter(){
- GUI gp = new GUI();
- gp.drawString("Hello People!",2,10);
- }
- }
- public abstract class GraphicObject {
- // declare fields
- //declare nonabstract methods
- abstract void draw(); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement