Let's say I created this class:
public class Panel extends JPanel{
private JTextBox textBox;
public Panel(){
this.textBox = new JTextBox(10);
add(this.textBox);
}
}
And in my main:
public class Main{
public static void main(String[] args){
Panel panel1 = new Panel();
Panel panel2 = new Panel();
}
}
In the class Panel
, is it necessary to call this
at every line, or can I leave it away? Or would it mess up the Panel
s?