• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Doubt in JFrame

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Im new to swing, please clear me this doubt.


import javax.swing.*;
import java.awt.*;
public class reference extends JFrame{
JPanel p1;
JButton b;
reference(){
b=new JButton("Click me");
setLayout(new FlowLayout());
add(b);
setVisible(true);

setSize(500,500);
}

public static void main(String str[])
{
new reference();
}

}


I have just extended JFrame in the code, now when im calling the setLayout(), setVisible(), setSize() without any reference variable.
I want to know which objects setLayout(), setVisible(), setSize() is being invoked. Whether its JFrame or its superclass?

Please correct me if im wrong.
really confused.
 
Rancher
Posts: 3244
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read this if you want answers to your questions.
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Camick wrote:Read this if you want answers to your questions.


Indeed!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic