• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic