The Artima Developer Community
Sponsored Link

Java Answers Forum
Need help on a Frame question...

7 replies on 1 page. Most recent reply: Nov 12, 2002 11:12 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 7 replies on 1 page
master

Posts: 7
Nickname: masterelr
Registered: Nov, 2002

Need help on a Frame question... Posted: Oct 31, 2002 10:56 PM
Reply to this message Reply
Advertisement
I hope someone can help me out with this question...
- Define a class, called MyFrame, which implements a frame by extending the Frame superclass. Your class should contain a constructor, which creates the frame with a named title bar. In addition to this, include in your declaration a protected button b, a protected checkbox group cg, and a protected checkbox c.

Thanks...


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Need help on a Frame question... Posted: Nov 4, 2002 4:42 PM
Reply to this message Reply
import java.awt.*;
 
public class MyFrame extends Frame{
 
     protected Button b;
     protected CheckboxGroup cg
     protected Checkbox c;
     public MyFrame(){
          super("MyFrame");
     }
}

master

Posts: 7
Nickname: masterelr
Registered: Nov, 2002

Re: Need help on a Frame question... Posted: Nov 4, 2002 11:27 PM
Reply to this message Reply
Thanks a lot Charles..!

ajith

Posts: 1
Nickname: ajiya
Registered: Nov, 2002

Re: Need help on a Frame question... Posted: Nov 6, 2002 8:06 PM
Reply to this message Reply
>
> import java.awt.*;
> 
> public class MyFrame extends Frame{
> 
> protected Button b;
> protected CheckboxGroup cg
> protected Checkbox c;
> public MyFrame(){
> super("MyFrame");
> }
> }
> 

master

Posts: 7
Nickname: masterelr
Registered: Nov, 2002

Re: Need help on a Frame question... Posted: Nov 6, 2002 11:39 PM
Reply to this message Reply
Don't you need like a "main" or "(String args[])" to able to execute it?

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Need help on a Frame question... Posted: Nov 7, 2002 10:41 AM
Reply to this message Reply
If you are running an application, you need to either add a main method to it or call it from another class which has one. If running from an applet, no.

master

Posts: 7
Nickname: masterelr
Registered: Nov, 2002

Re: Need help on a Frame question... Posted: Nov 7, 2002 9:51 PM
Reply to this message Reply
Yeah..I'm running from an application....

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Need help on a Frame question... Posted: Nov 12, 2002 11:12 AM
Reply to this message Reply
So if you are running as an application you add a main method:
public static void main(String[] args){
 
}


and of course finish the program.

Flat View: This topic has 7 replies on 1 page
Topic: How to delete random item from multi dimensional array Previous Topic   Next Topic Topic: need help about byte offset from class data buffer

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use