Based on the following example :
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
public class ExempleJFrame extends JFrame {
public ExempleJFrame() {
super("JFrame example");
setLocation(50, 50);
setSize(200, 200);
getContentPane().add(new JLabel("This is a text label!", SwingConstants.CENTER));
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args) {
ExempleJFrame frame = new ExempleJFrame();
frame.setVisible(true);
}
}
Is there a way to make it more explicit that I am calling a member method (see setLocation()
and setSize()
)?
I am looking for something in the lines of this.setLocation()
to make it explicit that I call a member method and not something from outer space.