By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

Adding something to a frame under the javax.swing.JFrame Package

P: 66
Hello,

I am trying to show a shape in the Javax.swing.JFrame package. I am using a frame to show it, but I can not get the add method to work. Can someone give me a good example of adding something to a frame with an add method. My code looks like the following:

frame.add(component);

I get an error message when trying to add the component to the frame. Any suggestions please....
Sep 8 '07 #1
Share this Question
Share on Google+
1 Reply


P: 66
Hello,

I am trying to show a shape in the Javax.swing.JFrame package. I am using a frame to show it, but I can not get the add method to work. Can someone give me a good example of adding something to a frame with an add method. My code looks like the following:

frame.add(component);

I get an error message when trying to add the component to the frame. Any suggestions please....
I finally figured it out! I needed a subclass of my shape class. This was introduced via using the keyword extend and the JComponents package. This helped to pick up the component in the program.

Problem Solved....
Sep 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.