0

// The below is the main class i'm using.

import javax.swing.JFrame;

public class Workspace {

    public static void main(String[] args){

    dummyClass var1 = new dummyClass();

    var1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    var1.setSize(100,100);
    var1.setVisible(true);
    }
}

// The below is the subclass i'm using.

import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class dummyClass extends JFrame {
    private JLabel item1;

    public dummyClass() {
        super("I'm the title;");
        setLayout(new FlowLayout());

        item1.setToolTipText("I'm the ToolTipText");
        add(item1);
    }
}
Vladimir Vagaytsev
  • 2,871
  • 9
  • 33
  • 36

0 Answers0