aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes extends Frame help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "extends Frame help" Watch "extends Frame help" New topic
Author

extends Frame help

kieran pattni
Ranch Hand

Joined: Jan 19, 2004
Posts: 47
import java.awt.*;
import java.awt.event.*;
public class CheckgroupApp extends Frame
implements ItemListener

private CheckboxGroup nn = new CheckboxGroup();
public showGui()
{
setLayout(new GridLaout(4,1);
add()//
seVisible();//without using instance of Frame class..i dont understand..


///some code

my question is why i have to use an instane of Frame class to add components directly..
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> my question is why i have to use an instane of Frame class to add components directly..

you need on instance of a Frame/JFrame to work with - it is a top level container

either

kieran pattni
Ranch Hand

Joined: Jan 19, 2004
Posts: 47
sorry my error..Q? was why i dont have to use a instance of the Frame class..
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> sorry my error..Q? was why i dont have to use a instance of the Frame class..

by extending Frame, the class is a Frame, and inherits all the methods of Frame
 
Consider Paul's rocket mass heater.
 
subject: extends Frame help